diff --git a/go.mod b/go.mod index 122ad0f2568..40c2b720864 100644 --- a/go.mod +++ b/go.mod @@ -43,7 +43,7 @@ require ( github.com/google/gnostic v0.5.7-v3refs github.com/google/go-cmp v0.5.9 github.com/google/gofuzz v1.1.0 - github.com/google/uuid v1.1.2 + github.com/google/uuid v1.3.0 github.com/ishidawataru/sctp v0.0.0-20190723014705-7c296d48a2b5 github.com/libopenstorage/openstorage v1.0.0 github.com/lithammer/dedent v1.1.0 @@ -64,7 +64,7 @@ require ( github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.1 github.com/vishvananda/netlink v1.1.0 - github.com/vmware/govmomi v0.20.3 + github.com/vmware/govmomi v0.30.0 go.etcd.io/etcd/api/v3 v3.5.5 go.etcd.io/etcd/client/pkg/v3 v3.5.5 go.etcd.io/etcd/client/v3 v3.5.5 diff --git a/go.sum b/go.sum index 14a9feadbe8..c31a14977ba 100644 --- a/go.sum +++ b/go.sum @@ -399,8 +399,9 @@ github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm4 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -482,8 +483,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -618,6 +619,7 @@ github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzG github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rubiojr/go-vhd v0.0.0-20200706105327-02e210299021 h1:if3/24+h9Sq6eDx8UUz1SO9cT9tizyIsATfB7b4D3tc= github.com/rubiojr/go-vhd v0.0.0-20200706105327-02e210299021/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -687,8 +689,8 @@ github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYp github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae h1:4hwBBUfQCFe3Cym0ZtKyq7L16eZUtYKs+BaHDN6mAns= github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= -github.com/vmware/govmomi v0.20.3 h1:gpw/0Ku+6RgF3jsi7fnCLmlcikBHfKBCUcu1qgc16OU= -github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= +github.com/vmware/govmomi v0.30.0 h1:Fm8ugPnnlMSTSceDKY9goGvjmqc6eQLPUSUeNXdpeXA= +github.com/vmware/govmomi v0.30.0/go.mod h1:F7adsVewLNHsW/IIm7ziFURaXDaHEwcc+ym4r3INMdY= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= github.com/xlab/treeprint v1.1.0 h1:G/1DjNkPpfZCFt9CSh6b5/nY4VimlbHF3Rh4obvtzDk= diff --git a/staging/src/k8s.io/api/go.mod b/staging/src/k8s.io/api/go.mod index 90cbaffd7dd..91839760676 100644 --- a/staging/src/k8s.io/api/go.mod +++ b/staging/src/k8s.io/api/go.mod @@ -17,10 +17,11 @@ require ( github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/kr/pretty v0.2.1 // indirect + github.com/kr/text v0.2.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/spf13/pflag v1.0.5 // indirect golang.org/x/net v0.4.0 // indirect golang.org/x/text v0.5.0 // indirect diff --git a/staging/src/k8s.io/api/go.sum b/staging/src/k8s.io/api/go.sum index a96767b5b1d..9c40c6dd1cb 100644 --- a/staging/src/k8s.io/api/go.sum +++ b/staging/src/k8s.io/api/go.sum @@ -1,3 +1,4 @@ +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -19,11 +20,9 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -31,6 +30,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/staging/src/k8s.io/apiextensions-apiserver/go.mod b/staging/src/k8s.io/apiextensions-apiserver/go.mod index 73d8367ee6d..27d41ef08e7 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/go.mod +++ b/staging/src/k8s.io/apiextensions-apiserver/go.mod @@ -11,7 +11,7 @@ require ( github.com/google/gnostic v0.5.7-v3refs github.com/google/go-cmp v0.5.9 github.com/google/gofuzz v1.1.0 - github.com/google/uuid v1.1.2 + github.com/google/uuid v1.3.0 github.com/spf13/cobra v1.6.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.1 diff --git a/staging/src/k8s.io/apiextensions-apiserver/go.sum b/staging/src/k8s.io/apiextensions-apiserver/go.sum index a11a1ac0aeb..31260025f14 100644 --- a/staging/src/k8s.io/apiextensions-apiserver/go.sum +++ b/staging/src/k8s.io/apiextensions-apiserver/go.sum @@ -233,8 +233,9 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -301,8 +302,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -385,6 +386,7 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= diff --git a/staging/src/k8s.io/apimachinery/go.mod b/staging/src/k8s.io/apimachinery/go.mod index e833d5ece6c..2b1a3273e3c 100644 --- a/staging/src/k8s.io/apimachinery/go.mod +++ b/staging/src/k8s.io/apimachinery/go.mod @@ -14,7 +14,7 @@ require ( github.com/google/gnostic v0.5.7-v3refs github.com/google/go-cmp v0.5.9 github.com/google/gofuzz v1.1.0 - github.com/google/uuid v1.1.2 + github.com/google/uuid v1.3.0 github.com/moby/spdystream v0.2.0 github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f github.com/spf13/pflag v1.0.5 @@ -32,7 +32,7 @@ require ( require ( github.com/go-logr/logr v1.2.3 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/kr/text v0.2.0 // indirect + github.com/kr/pretty v0.3.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/onsi/ginkgo/v2 v2.7.0 // indirect diff --git a/staging/src/k8s.io/apimachinery/go.sum b/staging/src/k8s.io/apimachinery/go.sum index 3907e8a4fcb..2ba5c845d6b 100644 --- a/staging/src/k8s.io/apimachinery/go.sum +++ b/staging/src/k8s.io/apimachinery/go.sum @@ -45,16 +45,18 @@ github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -77,6 +79,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= @@ -159,9 +163,11 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/staging/src/k8s.io/apiserver/go.mod b/staging/src/k8s.io/apiserver/go.mod index bfc2d293a4a..91b2674edef 100644 --- a/staging/src/k8s.io/apiserver/go.mod +++ b/staging/src/k8s.io/apiserver/go.mod @@ -16,7 +16,7 @@ require ( github.com/google/gnostic v0.5.7-v3refs github.com/google/go-cmp v0.5.9 github.com/google/gofuzz v1.1.0 - github.com/google/uuid v1.1.2 + github.com/google/uuid v1.3.0 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 github.com/spf13/pflag v1.0.5 diff --git a/staging/src/k8s.io/apiserver/go.sum b/staging/src/k8s.io/apiserver/go.sum index 61ac5894bef..02279e21278 100644 --- a/staging/src/k8s.io/apiserver/go.sum +++ b/staging/src/k8s.io/apiserver/go.sum @@ -260,8 +260,9 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -330,8 +331,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -414,6 +415,7 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= diff --git a/staging/src/k8s.io/cli-runtime/go.mod b/staging/src/k8s.io/cli-runtime/go.mod index 9138413a94c..9ec4d44076f 100644 --- a/staging/src/k8s.io/cli-runtime/go.mod +++ b/staging/src/k8s.io/cli-runtime/go.mod @@ -8,7 +8,7 @@ require ( github.com/davecgh/go-spew v1.1.1 github.com/evanphx/json-patch v4.12.0+incompatible github.com/google/gnostic v0.5.7-v3refs - github.com/google/uuid v1.1.2 + github.com/google/uuid v1.3.0 github.com/liggitt/tabwriter v0.0.0-20181228230101-89fcab3d43de github.com/spf13/cobra v1.6.0 github.com/spf13/pflag v1.0.5 diff --git a/staging/src/k8s.io/cli-runtime/go.sum b/staging/src/k8s.io/cli-runtime/go.sum index 88d38e84389..db9d3ca9fca 100644 --- a/staging/src/k8s.io/cli-runtime/go.sum +++ b/staging/src/k8s.io/cli-runtime/go.sum @@ -127,8 +127,8 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= @@ -150,8 +150,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -177,6 +177,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI= diff --git a/staging/src/k8s.io/client-go/go.mod b/staging/src/k8s.io/client-go/go.mod index 86d1cb2ee06..8416c43371f 100644 --- a/staging/src/k8s.io/client-go/go.mod +++ b/staging/src/k8s.io/client-go/go.mod @@ -13,7 +13,7 @@ require ( github.com/google/gnostic v0.5.7-v3refs github.com/google/go-cmp v0.5.9 github.com/google/gofuzz v1.1.0 - github.com/google/uuid v1.1.2 + github.com/google/uuid v1.3.0 github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 github.com/imdario/mergo v0.3.6 github.com/peterbourgon/diskv v2.0.1+incompatible diff --git a/staging/src/k8s.io/client-go/go.sum b/staging/src/k8s.io/client-go/go.sum index bf432bd9387..d8d2081b634 100644 --- a/staging/src/k8s.io/client-go/go.sum +++ b/staging/src/k8s.io/client-go/go.sum @@ -126,8 +126,8 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -148,8 +148,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -175,6 +175,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= diff --git a/staging/src/k8s.io/cloud-provider/go.mod b/staging/src/k8s.io/cloud-provider/go.mod index d6a6fffb4b6..4e5e7aa7dc7 100644 --- a/staging/src/k8s.io/cloud-provider/go.mod +++ b/staging/src/k8s.io/cloud-provider/go.mod @@ -46,7 +46,7 @@ require ( github.com/google/cel-go v0.12.6 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/gofuzz v1.1.0 // indirect - github.com/google/uuid v1.1.2 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect github.com/imdario/mergo v0.3.6 // indirect diff --git a/staging/src/k8s.io/cloud-provider/go.sum b/staging/src/k8s.io/cloud-provider/go.sum index 139b2dde8be..fa1eb3377a7 100644 --- a/staging/src/k8s.io/cloud-provider/go.sum +++ b/staging/src/k8s.io/cloud-provider/go.sum @@ -200,8 +200,9 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= @@ -239,8 +240,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -300,6 +301,7 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= diff --git a/staging/src/k8s.io/cluster-bootstrap/go.sum b/staging/src/k8s.io/cluster-bootstrap/go.sum index 872c3a199a6..e5d7ca0b5d0 100644 --- a/staging/src/k8s.io/cluster-bootstrap/go.sum +++ b/staging/src/k8s.io/cluster-bootstrap/go.sum @@ -14,7 +14,7 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -23,6 +23,7 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= diff --git a/staging/src/k8s.io/code-generator/examples/go.sum b/staging/src/k8s.io/code-generator/examples/go.sum index 887cf33081d..15cce54701d 100644 --- a/staging/src/k8s.io/code-generator/examples/go.sum +++ b/staging/src/k8s.io/code-generator/examples/go.sum @@ -134,8 +134,9 @@ github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -156,8 +157,9 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -202,12 +204,16 @@ github.com/onsi/gomega v1.24.1/go.mod h1:3AOiACssS3/MajrniINInwbfOOtfZvplPzuRSmv github.com/onsi/gomega v1.24.2 h1:J/tulyYK6JwBldPViHJReihxxZ+22FHs0piGjQAvoUE= github.com/onsi/gomega v1.24.2/go.mod h1:gs3J10IS7Z7r7eXRoNJIrNqU4ToQukCJhFtKrWgHWnk= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= diff --git a/staging/src/k8s.io/code-generator/go.mod b/staging/src/k8s.io/code-generator/go.mod index 9c337bc65e9..856b3f8f3ee 100644 --- a/staging/src/k8s.io/code-generator/go.mod +++ b/staging/src/k8s.io/code-generator/go.mod @@ -25,6 +25,7 @@ require ( github.com/google/gofuzz v1.1.0 // indirect github.com/josharian/intern v1.0.0 // indirect github.com/json-iterator/go v1.1.12 // indirect + github.com/kr/pretty v0.3.0 // indirect github.com/mailru/easyjson v0.7.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect diff --git a/staging/src/k8s.io/code-generator/go.sum b/staging/src/k8s.io/code-generator/go.sum index 6844a09d51e..b7c34e4d57a 100644 --- a/staging/src/k8s.io/code-generator/go.sum +++ b/staging/src/k8s.io/code-generator/go.sum @@ -54,9 +54,11 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -75,6 +77,8 @@ github.com/onsi/gomega v1.24.2/go.mod h1:gs3J10IS7Z7r7eXRoNJIrNqU4ToQukCJhFtKrWg github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= @@ -161,9 +165,11 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= diff --git a/staging/src/k8s.io/component-base/go.sum b/staging/src/k8s.io/component-base/go.sum index 558ec1f4b63..a8de1740f29 100644 --- a/staging/src/k8s.io/component-base/go.sum +++ b/staging/src/k8s.io/component-base/go.sum @@ -210,8 +210,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -270,6 +270,7 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= diff --git a/staging/src/k8s.io/component-helpers/go.sum b/staging/src/k8s.io/component-helpers/go.sum index e884f42e839..f734dfa670c 100644 --- a/staging/src/k8s.io/component-helpers/go.sum +++ b/staging/src/k8s.io/component-helpers/go.sum @@ -120,7 +120,7 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -136,8 +136,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -159,6 +159,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/staging/src/k8s.io/controller-manager/go.mod b/staging/src/k8s.io/controller-manager/go.mod index 2ea62c349de..8f11faaffe5 100644 --- a/staging/src/k8s.io/controller-manager/go.mod +++ b/staging/src/k8s.io/controller-manager/go.mod @@ -43,7 +43,7 @@ require ( github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.1.0 // indirect - github.com/google/uuid v1.1.2 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect github.com/imdario/mergo v0.3.6 // indirect diff --git a/staging/src/k8s.io/controller-manager/go.sum b/staging/src/k8s.io/controller-manager/go.sum index 34e6ac5640c..1c5b9681468 100644 --- a/staging/src/k8s.io/controller-manager/go.sum +++ b/staging/src/k8s.io/controller-manager/go.sum @@ -195,8 +195,9 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= @@ -234,8 +235,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -293,6 +294,7 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= diff --git a/staging/src/k8s.io/cri-api/go.mod b/staging/src/k8s.io/cri-api/go.mod index 64b1641a191..e180a2c5b93 100644 --- a/staging/src/k8s.io/cri-api/go.mod +++ b/staging/src/k8s.io/cri-api/go.mod @@ -14,7 +14,7 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/golang/protobuf v1.5.2 // indirect github.com/google/go-cmp v0.5.9 // indirect - github.com/kr/text v0.2.0 // indirect + github.com/kr/pretty v0.3.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/net v0.4.0 // indirect golang.org/x/sys v0.3.0 // indirect diff --git a/staging/src/k8s.io/cri-api/go.sum b/staging/src/k8s.io/cri-api/go.sum index af264ea624d..505df1ee450 100644 --- a/staging/src/k8s.io/cri-api/go.sum +++ b/staging/src/k8s.io/cri-api/go.sum @@ -53,8 +53,10 @@ github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+ github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -63,6 +65,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -167,8 +171,10 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/staging/src/k8s.io/csi-translation-lib/go.mod b/staging/src/k8s.io/csi-translation-lib/go.mod index a20bba79f74..4852bd45df5 100644 --- a/staging/src/k8s.io/csi-translation-lib/go.mod +++ b/staging/src/k8s.io/csi-translation-lib/go.mod @@ -16,7 +16,7 @@ require ( github.com/go-logr/logr v1.2.3 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/google/gofuzz v1.1.0 // indirect - github.com/google/uuid v1.1.2 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/json-iterator/go v1.1.12 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect diff --git a/staging/src/k8s.io/csi-translation-lib/go.sum b/staging/src/k8s.io/csi-translation-lib/go.sum index e499670a11c..0cca1c1d120 100644 --- a/staging/src/k8s.io/csi-translation-lib/go.sum +++ b/staging/src/k8s.io/csi-translation-lib/go.sum @@ -10,13 +10,13 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0 h1:Hsa8mG0dQ46ij8Sl2AYJDUv1oA9/d6Vk+3LG99Oe02g= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -25,6 +25,7 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= diff --git a/staging/src/k8s.io/dynamic-resource-allocation/go.sum b/staging/src/k8s.io/dynamic-resource-allocation/go.sum index 23103b16f0f..e6b1ce65827 100644 --- a/staging/src/k8s.io/dynamic-resource-allocation/go.sum +++ b/staging/src/k8s.io/dynamic-resource-allocation/go.sum @@ -134,8 +134,8 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -152,8 +152,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -176,6 +176,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= diff --git a/staging/src/k8s.io/kube-aggregator/go.mod b/staging/src/k8s.io/kube-aggregator/go.mod index 0a60636c392..7d4450b2f11 100644 --- a/staging/src/k8s.io/kube-aggregator/go.mod +++ b/staging/src/k8s.io/kube-aggregator/go.mod @@ -47,7 +47,7 @@ require ( github.com/google/cel-go v0.12.6 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-cmp v0.5.9 // indirect - github.com/google/uuid v1.1.2 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect github.com/imdario/mergo v0.3.6 // indirect diff --git a/staging/src/k8s.io/kube-aggregator/go.sum b/staging/src/k8s.io/kube-aggregator/go.sum index b44b2a585b4..35bcc133cf7 100644 --- a/staging/src/k8s.io/kube-aggregator/go.sum +++ b/staging/src/k8s.io/kube-aggregator/go.sum @@ -197,8 +197,9 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= @@ -236,8 +237,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -297,6 +298,7 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= diff --git a/staging/src/k8s.io/kube-controller-manager/go.mod b/staging/src/k8s.io/kube-controller-manager/go.mod index 1e5e619825d..c350b27ae71 100644 --- a/staging/src/k8s.io/kube-controller-manager/go.mod +++ b/staging/src/k8s.io/kube-controller-manager/go.mod @@ -15,9 +15,10 @@ require ( github.com/gogo/protobuf v1.3.2 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/kr/pretty v0.2.1 // indirect + github.com/kr/text v0.2.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect golang.org/x/net v0.4.0 // indirect golang.org/x/text v0.5.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/staging/src/k8s.io/kube-controller-manager/go.sum b/staging/src/k8s.io/kube-controller-manager/go.sum index 33d7d2f4a18..657218a398a 100644 --- a/staging/src/k8s.io/kube-controller-manager/go.sum +++ b/staging/src/k8s.io/kube-controller-manager/go.sum @@ -1,3 +1,4 @@ +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -14,11 +15,9 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -26,6 +25,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/staging/src/k8s.io/kube-proxy/go.mod b/staging/src/k8s.io/kube-proxy/go.mod index a5e1197e39d..caa1fdf3c58 100644 --- a/staging/src/k8s.io/kube-proxy/go.mod +++ b/staging/src/k8s.io/kube-proxy/go.mod @@ -15,9 +15,10 @@ require ( github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/json-iterator/go v1.1.12 // indirect - github.com/kr/pretty v0.2.1 // indirect + github.com/kr/text v0.2.0 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect golang.org/x/net v0.4.0 // indirect golang.org/x/text v0.5.0 // indirect gopkg.in/inf.v0 v0.9.1 // indirect diff --git a/staging/src/k8s.io/kube-proxy/go.sum b/staging/src/k8s.io/kube-proxy/go.sum index 6f87efc6604..7523c5b6d8d 100644 --- a/staging/src/k8s.io/kube-proxy/go.sum +++ b/staging/src/k8s.io/kube-proxy/go.sum @@ -1,3 +1,4 @@ +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -15,11 +16,9 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= -github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= @@ -27,6 +26,8 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/staging/src/k8s.io/kube-scheduler/go.sum b/staging/src/k8s.io/kube-scheduler/go.sum index 7a7ef81487a..43c742d3c90 100644 --- a/staging/src/k8s.io/kube-scheduler/go.sum +++ b/staging/src/k8s.io/kube-scheduler/go.sum @@ -15,7 +15,7 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -24,6 +24,7 @@ github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9G github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= diff --git a/staging/src/k8s.io/kubectl/go.mod b/staging/src/k8s.io/kubectl/go.mod index 2d4d1185113..c3fc69e3bd0 100644 --- a/staging/src/k8s.io/kubectl/go.mod +++ b/staging/src/k8s.io/kubectl/go.mod @@ -60,7 +60,7 @@ require ( github.com/google/btree v1.0.1 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/google/uuid v1.1.2 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect github.com/imdario/mergo v0.3.6 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect diff --git a/staging/src/k8s.io/kubectl/go.sum b/staging/src/k8s.io/kubectl/go.sum index 4b03dd3445e..993d51687ee 100644 --- a/staging/src/k8s.io/kubectl/go.sum +++ b/staging/src/k8s.io/kubectl/go.sum @@ -152,8 +152,8 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= @@ -178,8 +178,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -222,6 +222,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= diff --git a/staging/src/k8s.io/kubelet/go.sum b/staging/src/k8s.io/kubelet/go.sum index 259602e51f3..f27ee70f428 100644 --- a/staging/src/k8s.io/kubelet/go.sum +++ b/staging/src/k8s.io/kubelet/go.sum @@ -168,7 +168,7 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -217,6 +217,7 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= diff --git a/staging/src/k8s.io/legacy-cloud-providers/go.mod b/staging/src/k8s.io/legacy-cloud-providers/go.mod index da4f3671fe9..216e05911a9 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/go.mod +++ b/staging/src/k8s.io/legacy-cloud-providers/go.mod @@ -16,7 +16,7 @@ require ( github.com/google/go-cmp v0.5.9 github.com/rubiojr/go-vhd v0.0.0-20200706105327-02e210299021 github.com/stretchr/testify v1.8.1 - github.com/vmware/govmomi v0.20.3 + github.com/vmware/govmomi v0.30.0 golang.org/x/crypto v0.1.0 golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b google.golang.org/api v0.60.0 @@ -57,7 +57,7 @@ require ( github.com/golang/protobuf v1.5.2 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/gofuzz v1.1.0 // indirect - github.com/google/uuid v1.1.2 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/googleapis/gax-go/v2 v2.1.1 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/josharian/intern v1.0.0 // indirect diff --git a/staging/src/k8s.io/legacy-cloud-providers/go.sum b/staging/src/k8s.io/legacy-cloud-providers/go.sum index 09bedc1e48e..233d2e537a8 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/go.sum +++ b/staging/src/k8s.io/legacy-cloud-providers/go.sum @@ -228,8 +228,9 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= @@ -263,8 +264,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -322,6 +323,7 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rubiojr/go-vhd v0.0.0-20200706105327-02e210299021 h1:if3/24+h9Sq6eDx8UUz1SO9cT9tizyIsATfB7b4D3tc= github.com/rubiojr/go-vhd v0.0.0-20200706105327-02e210299021/go.mod h1:DM5xW0nvfNNm2uytzsvhI3OnX8uzaRAg8UX/CnDqbto= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -346,8 +348,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/vmware/govmomi v0.20.3 h1:gpw/0Ku+6RgF3jsi7fnCLmlcikBHfKBCUcu1qgc16OU= -github.com/vmware/govmomi v0.20.3/go.mod h1:URlwyTFZX72RmxtxuaFL2Uj3fD1JTvZdx59bHWk6aFU= +github.com/vmware/govmomi v0.30.0 h1:Fm8ugPnnlMSTSceDKY9goGvjmqc6eQLPUSUeNXdpeXA= +github.com/vmware/govmomi v0.30.0/go.mod h1:F7adsVewLNHsW/IIm7ziFURaXDaHEwcc+ym4r3INMdY= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/connection_test.go b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/connection_test.go index 70301ebbbc5..5663afa4a2e 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/connection_test.go +++ b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vclib/connection_test.go @@ -21,6 +21,7 @@ import ( "crypto/sha1" "crypto/tls" "crypto/x509" + "errors" "fmt" "io/ioutil" "net/http" @@ -187,12 +188,9 @@ func verifyWrappedX509UnkownAuthorityErr(t *testing.T, err error) { if !ok { t.Fatalf("Expected to receive an url.Error, got '%s' (%#v)", err.Error(), err) } - x509Err, ok := urlErr.Err.(x509.UnknownAuthorityError) - if !ok { - t.Fatalf("Expected to receive a wrapped x509.UnknownAuthorityError, got: '%s' (%#v)", urlErr.Error(), urlErr) - } - if msg := x509Err.Error(); msg != "x509: certificate signed by unknown authority" { - t.Fatalf("Expected 'signed by unknown authority' error, got: '%s'", msg) + var x509err x509.UnknownAuthorityError + if !errors.As(urlErr.Err, &x509err) { + t.Fatalf("Expected to receive a wrapped x509.UnknownAuthorityError, got: '%s' (%#v)", urlErr.Err.Error(), urlErr.Err) } } diff --git a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_test.go b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_test.go index d2d34302ee0..06c67e4a926 100644 --- a/staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_test.go +++ b/staging/src/k8s.io/legacy-cloud-providers/vsphere/vsphere_test.go @@ -165,7 +165,8 @@ func configFromSimWithTLS(tlsConfig *tls.Config, insecureAllowed bool) (VSphereC model.Service.ServeMux.Handle(path, handler) // vAPI simulator - path, handler = vapi.New(s.URL, vpx.Setting) + paths, handler := vapi.New(s.URL, vpx.Setting) + path = paths[0] model.Service.ServeMux.Handle(path, handler) // Lookup Service simulator diff --git a/staging/src/k8s.io/metrics/go.sum b/staging/src/k8s.io/metrics/go.sum index d5d3281e0f1..af04bdd0e95 100644 --- a/staging/src/k8s.io/metrics/go.sum +++ b/staging/src/k8s.io/metrics/go.sum @@ -136,8 +136,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -159,6 +159,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= diff --git a/staging/src/k8s.io/mount-utils/go.mod b/staging/src/k8s.io/mount-utils/go.mod index 809fd70155d..e79b8b2767d 100644 --- a/staging/src/k8s.io/mount-utils/go.mod +++ b/staging/src/k8s.io/mount-utils/go.mod @@ -14,7 +14,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.2.3 // indirect - github.com/kr/text v0.2.0 // indirect + github.com/kr/pretty v0.3.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/sys v0.3.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect diff --git a/staging/src/k8s.io/mount-utils/go.sum b/staging/src/k8s.io/mount-utils/go.sum index bfbc1e947c2..ad7be3128ea 100644 --- a/staging/src/k8s.io/mount-utils/go.sum +++ b/staging/src/k8s.io/mount-utils/go.sum @@ -5,8 +5,10 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/go-logr/logr v1.2.0/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -15,6 +17,8 @@ github.com/moby/sys/mountinfo v0.6.2 h1:BzJjoreD5BMFNmD9Rus6gdd1pLuecOFPt8wC+Vyg github.com/moby/sys/mountinfo v0.6.2/go.mod h1:IJb6JQeOklcdMU9F5xQ8ZALD+CUr5VlGpwtX+VE0rpI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= @@ -26,8 +30,10 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/staging/src/k8s.io/noderesourcetopology-api/go.mod b/staging/src/k8s.io/noderesourcetopology-api/go.mod index 85338ac2048..53784e2408c 100644 --- a/staging/src/k8s.io/noderesourcetopology-api/go.mod +++ b/staging/src/k8s.io/noderesourcetopology-api/go.mod @@ -21,6 +21,7 @@ require ( github.com/mailru/easyjson v0.7.7 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/spf13/pflag v1.0.5 // indirect golang.org/x/mod v0.7.0 // indirect golang.org/x/sys v0.3.0 // indirect diff --git a/staging/src/k8s.io/noderesourcetopology-api/go.sum b/staging/src/k8s.io/noderesourcetopology-api/go.sum index d275a0ca9c3..a253fe53105 100644 --- a/staging/src/k8s.io/noderesourcetopology-api/go.sum +++ b/staging/src/k8s.io/noderesourcetopology-api/go.sum @@ -51,8 +51,8 @@ github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFF github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -67,6 +67,8 @@ github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjY github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= diff --git a/staging/src/k8s.io/pod-security-admission/go.mod b/staging/src/k8s.io/pod-security-admission/go.mod index f756d327893..7128873d7f5 100644 --- a/staging/src/k8s.io/pod-security-admission/go.mod +++ b/staging/src/k8s.io/pod-security-admission/go.mod @@ -45,7 +45,7 @@ require ( github.com/google/cel-go v0.12.6 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/gofuzz v1.1.0 // indirect - github.com/google/uuid v1.1.2 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect github.com/imdario/mergo v0.3.6 // indirect diff --git a/staging/src/k8s.io/pod-security-admission/go.sum b/staging/src/k8s.io/pod-security-admission/go.sum index eff3e2a8906..b9f5f2f7ec2 100644 --- a/staging/src/k8s.io/pod-security-admission/go.sum +++ b/staging/src/k8s.io/pod-security-admission/go.sum @@ -198,8 +198,9 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= @@ -237,8 +238,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -296,6 +297,7 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= diff --git a/staging/src/k8s.io/sample-apiserver/go.mod b/staging/src/k8s.io/sample-apiserver/go.mod index 0edd0fe7211..d47772744a3 100644 --- a/staging/src/k8s.io/sample-apiserver/go.mod +++ b/staging/src/k8s.io/sample-apiserver/go.mod @@ -41,7 +41,7 @@ require ( github.com/google/cel-go v0.12.6 // indirect github.com/google/gnostic v0.5.7-v3refs // indirect github.com/google/go-cmp v0.5.9 // indirect - github.com/google/uuid v1.1.2 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0 // indirect github.com/imdario/mergo v0.3.6 // indirect diff --git a/staging/src/k8s.io/sample-apiserver/go.sum b/staging/src/k8s.io/sample-apiserver/go.sum index 51c60b2109e..4af767e7804 100644 --- a/staging/src/k8s.io/sample-apiserver/go.sum +++ b/staging/src/k8s.io/sample-apiserver/go.sum @@ -197,8 +197,9 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= @@ -236,8 +237,8 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxv github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -295,6 +296,7 @@ github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5 github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= diff --git a/staging/src/k8s.io/sample-cli-plugin/go.mod b/staging/src/k8s.io/sample-cli-plugin/go.mod index 65d1bde9169..0c9381f0a74 100644 --- a/staging/src/k8s.io/sample-cli-plugin/go.mod +++ b/staging/src/k8s.io/sample-cli-plugin/go.mod @@ -27,7 +27,7 @@ require ( github.com/google/go-cmp v0.5.9 // indirect github.com/google/gofuzz v1.1.0 // indirect github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 // indirect - github.com/google/uuid v1.1.2 // indirect + github.com/google/uuid v1.3.0 // indirect github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect github.com/imdario/mergo v0.3.6 // indirect github.com/inconshreveable/mousetrap v1.0.1 // indirect diff --git a/staging/src/k8s.io/sample-cli-plugin/go.sum b/staging/src/k8s.io/sample-cli-plugin/go.sum index 88d38e84389..db9d3ca9fca 100644 --- a/staging/src/k8s.io/sample-cli-plugin/go.sum +++ b/staging/src/k8s.io/sample-cli-plugin/go.sum @@ -127,8 +127,8 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= +github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= @@ -150,8 +150,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -177,6 +177,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/spf13/cobra v1.6.0 h1:42a0n6jwCot1pUmomAp4T7DeMD+20LFv4Q54pxLf2LI= diff --git a/staging/src/k8s.io/sample-controller/go.sum b/staging/src/k8s.io/sample-controller/go.sum index c952681734d..b2dbedc3b26 100644 --- a/staging/src/k8s.io/sample-controller/go.sum +++ b/staging/src/k8s.io/sample-controller/go.sum @@ -123,7 +123,7 @@ github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= @@ -141,8 +141,8 @@ github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -164,6 +164,7 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/stoewer/go-strcase v1.2.0/go.mod h1:IBiWB2sKIp3wVVQ3Y035++gc+knqhUQag1KpM8ahLw8= diff --git a/vendor/github.com/google/uuid/hash.go b/vendor/github.com/google/uuid/hash.go index b1746163151..b404f4bec27 100644 --- a/vendor/github.com/google/uuid/hash.go +++ b/vendor/github.com/google/uuid/hash.go @@ -26,8 +26,8 @@ var ( // NewMD5 and NewSHA1. func NewHash(h hash.Hash, space UUID, data []byte, version int) UUID { h.Reset() - h.Write(space[:]) - h.Write(data) + h.Write(space[:]) //nolint:errcheck + h.Write(data) //nolint:errcheck s := h.Sum(nil) var uuid UUID copy(uuid[:], s) diff --git a/vendor/github.com/google/uuid/null.go b/vendor/github.com/google/uuid/null.go new file mode 100644 index 00000000000..d7fcbf28651 --- /dev/null +++ b/vendor/github.com/google/uuid/null.go @@ -0,0 +1,118 @@ +// Copyright 2021 Google Inc. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package uuid + +import ( + "bytes" + "database/sql/driver" + "encoding/json" + "fmt" +) + +var jsonNull = []byte("null") + +// NullUUID represents a UUID that may be null. +// NullUUID implements the SQL driver.Scanner interface so +// it can be used as a scan destination: +// +// var u uuid.NullUUID +// err := db.QueryRow("SELECT name FROM foo WHERE id=?", id).Scan(&u) +// ... +// if u.Valid { +// // use u.UUID +// } else { +// // NULL value +// } +// +type NullUUID struct { + UUID UUID + Valid bool // Valid is true if UUID is not NULL +} + +// Scan implements the SQL driver.Scanner interface. +func (nu *NullUUID) Scan(value interface{}) error { + if value == nil { + nu.UUID, nu.Valid = Nil, false + return nil + } + + err := nu.UUID.Scan(value) + if err != nil { + nu.Valid = false + return err + } + + nu.Valid = true + return nil +} + +// Value implements the driver Valuer interface. +func (nu NullUUID) Value() (driver.Value, error) { + if !nu.Valid { + return nil, nil + } + // Delegate to UUID Value function + return nu.UUID.Value() +} + +// MarshalBinary implements encoding.BinaryMarshaler. +func (nu NullUUID) MarshalBinary() ([]byte, error) { + if nu.Valid { + return nu.UUID[:], nil + } + + return []byte(nil), nil +} + +// UnmarshalBinary implements encoding.BinaryUnmarshaler. +func (nu *NullUUID) UnmarshalBinary(data []byte) error { + if len(data) != 16 { + return fmt.Errorf("invalid UUID (got %d bytes)", len(data)) + } + copy(nu.UUID[:], data) + nu.Valid = true + return nil +} + +// MarshalText implements encoding.TextMarshaler. +func (nu NullUUID) MarshalText() ([]byte, error) { + if nu.Valid { + return nu.UUID.MarshalText() + } + + return jsonNull, nil +} + +// UnmarshalText implements encoding.TextUnmarshaler. +func (nu *NullUUID) UnmarshalText(data []byte) error { + id, err := ParseBytes(data) + if err != nil { + nu.Valid = false + return err + } + nu.UUID = id + nu.Valid = true + return nil +} + +// MarshalJSON implements json.Marshaler. +func (nu NullUUID) MarshalJSON() ([]byte, error) { + if nu.Valid { + return json.Marshal(nu.UUID) + } + + return jsonNull, nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (nu *NullUUID) UnmarshalJSON(data []byte) error { + if bytes.Equal(data, jsonNull) { + *nu = NullUUID{} + return nil // valid null UUID + } + err := json.Unmarshal(data, &nu.UUID) + nu.Valid = err == nil + return err +} diff --git a/vendor/github.com/google/uuid/sql.go b/vendor/github.com/google/uuid/sql.go index f326b54db37..2e02ec06c01 100644 --- a/vendor/github.com/google/uuid/sql.go +++ b/vendor/github.com/google/uuid/sql.go @@ -9,7 +9,7 @@ import ( "fmt" ) -// Scan implements sql.Scanner so UUIDs can be read from databases transparently +// Scan implements sql.Scanner so UUIDs can be read from databases transparently. // Currently, database types that map to string and []byte are supported. Please // consult database-specific driver documentation for matching types. func (uuid *UUID) Scan(src interface{}) error { diff --git a/vendor/github.com/google/uuid/uuid.go b/vendor/github.com/google/uuid/uuid.go index 524404cc522..a57207aeb6f 100644 --- a/vendor/github.com/google/uuid/uuid.go +++ b/vendor/github.com/google/uuid/uuid.go @@ -12,6 +12,7 @@ import ( "fmt" "io" "strings" + "sync" ) // A UUID is a 128 bit (16 byte) Universal Unique IDentifier as defined in RFC @@ -33,7 +34,27 @@ const ( Future // Reserved for future definition. ) -var rander = rand.Reader // random function +const randPoolSize = 16 * 16 + +var ( + rander = rand.Reader // random function + poolEnabled = false + poolMu sync.Mutex + poolPos = randPoolSize // protected with poolMu + pool [randPoolSize]byte // protected with poolMu +) + +type invalidLengthError struct{ len int } + +func (err invalidLengthError) Error() string { + return fmt.Sprintf("invalid UUID length: %d", err.len) +} + +// IsInvalidLengthError is matcher function for custom error invalidLengthError +func IsInvalidLengthError(err error) bool { + _, ok := err.(invalidLengthError) + return ok +} // Parse decodes s into a UUID or returns an error. Both the standard UUID // forms of xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx and @@ -68,7 +89,7 @@ func Parse(s string) (UUID, error) { } return uuid, nil default: - return uuid, fmt.Errorf("invalid UUID length: %d", len(s)) + return uuid, invalidLengthError{len(s)} } // s is now at least 36 bytes long // it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx @@ -112,7 +133,7 @@ func ParseBytes(b []byte) (UUID, error) { } return uuid, nil default: - return uuid, fmt.Errorf("invalid UUID length: %d", len(b)) + return uuid, invalidLengthError{len(b)} } // s is now at least 36 bytes long // it must be of the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx @@ -243,3 +264,31 @@ func SetRand(r io.Reader) { } rander = r } + +// EnableRandPool enables internal randomness pool used for Random +// (Version 4) UUID generation. The pool contains random bytes read from +// the random number generator on demand in batches. Enabling the pool +// may improve the UUID generation throughput significantly. +// +// Since the pool is stored on the Go heap, this feature may be a bad fit +// for security sensitive applications. +// +// Both EnableRandPool and DisableRandPool are not thread-safe and should +// only be called when there is no possibility that New or any other +// UUID Version 4 generation function will be called concurrently. +func EnableRandPool() { + poolEnabled = true +} + +// DisableRandPool disables the randomness pool if it was previously +// enabled with EnableRandPool. +// +// Both EnableRandPool and DisableRandPool are not thread-safe and should +// only be called when there is no possibility that New or any other +// UUID Version 4 generation function will be called concurrently. +func DisableRandPool() { + poolEnabled = false + defer poolMu.Unlock() + poolMu.Lock() + poolPos = randPoolSize +} diff --git a/vendor/github.com/google/uuid/version4.go b/vendor/github.com/google/uuid/version4.go index c110465db59..7697802e4d1 100644 --- a/vendor/github.com/google/uuid/version4.go +++ b/vendor/github.com/google/uuid/version4.go @@ -14,11 +14,21 @@ func New() UUID { return Must(NewRandom()) } +// NewString creates a new random UUID and returns it as a string or panics. +// NewString is equivalent to the expression +// +// uuid.New().String() +func NewString() string { + return Must(NewRandom()).String() +} + // NewRandom returns a Random (Version 4) UUID. // // The strength of the UUIDs is based on the strength of the crypto/rand // package. // +// Uses the randomness pool if it was enabled with EnableRandPool. +// // A note about uniqueness derived from the UUID Wikipedia entry: // // Randomly generated UUIDs have 122 random bits. One's annual risk of being @@ -27,7 +37,10 @@ func New() UUID { // equivalent to the odds of creating a few tens of trillions of UUIDs in a // year and having one duplicate. func NewRandom() (UUID, error) { - return NewRandomFromReader(rander) + if !poolEnabled { + return NewRandomFromReader(rander) + } + return newRandomFromPool() } // NewRandomFromReader returns a UUID based on bytes read from a given io.Reader. @@ -41,3 +54,23 @@ func NewRandomFromReader(r io.Reader) (UUID, error) { uuid[8] = (uuid[8] & 0x3f) | 0x80 // Variant is 10 return uuid, nil } + +func newRandomFromPool() (UUID, error) { + var uuid UUID + poolMu.Lock() + if poolPos == randPoolSize { + _, err := io.ReadFull(rander, pool[:]) + if err != nil { + poolMu.Unlock() + return Nil, err + } + poolPos = 0 + } + copy(uuid[:], pool[poolPos:(poolPos+16)]) + poolPos += 16 + poolMu.Unlock() + + uuid[6] = (uuid[6] & 0x0f) | 0x40 // Version 4 + uuid[8] = (uuid[8] & 0x3f) | 0x80 // Variant is 10 + return uuid, nil +} diff --git a/vendor/github.com/vmware/govmomi/.dockerignore b/vendor/github.com/vmware/govmomi/.dockerignore new file mode 100644 index 00000000000..9f5fdc6b9e6 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/.dockerignore @@ -0,0 +1,2 @@ +Dockerfile* +.*ignore \ No newline at end of file diff --git a/vendor/github.com/vmware/govmomi/.gitignore b/vendor/github.com/vmware/govmomi/.gitignore index 9099ba3496c..675d86a0ade 100644 --- a/vendor/github.com/vmware/govmomi/.gitignore +++ b/vendor/github.com/vmware/govmomi/.gitignore @@ -1,3 +1,13 @@ secrets.yml dist/ .idea/ + +# ignore tools binaries +/git-chglog + +# ignore RELEASE-specific CHANGELOG +/RELEASE_CHANGELOG.md + +# Ignore editor temp files +*~ +.vscode/ diff --git a/vendor/github.com/vmware/govmomi/.golangci.yml b/vendor/github.com/vmware/govmomi/.golangci.yml new file mode 100644 index 00000000000..d6392fb9489 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/.golangci.yml @@ -0,0 +1,18 @@ +linters: + disable-all: true + enable: + - goimports + - govet + # Run with --fast=false for more extensive checks + fast: true +# override defaults +linters-settings: + goimports: + # put imports beginning with prefix after 3rd-party packages; + # it's a comma-separated list of prefixes + local-prefixes: github.com/vmware/govmomi +run: + timeout: 6m + skip-dirs: + - vim25/xml + - cns/types diff --git a/vendor/github.com/vmware/govmomi/.goreleaser.yml b/vendor/github.com/vmware/govmomi/.goreleaser.yml index a15c5d7d7c1..69b80be383c 100644 --- a/vendor/github.com/vmware/govmomi/.goreleaser.yml +++ b/vendor/github.com/vmware/govmomi/.goreleaser.yml @@ -1,57 +1,148 @@ --- -project_name: govc +project_name: govmomi + builds: -- goos: - - linux - - darwin - - windows - - freebsd - goarch: - - amd64 - - 386 - env: - - CGO_ENABLED=0 - main: ./govc/main.go - binary: govc - flags: -compiler gc - ldflags: -X github.com/vmware/govmomi/govc/flags.GitVersion={{.Version}} -archive: - name_template: '{{ .ProjectName }}_{{ .Os }}_{{ .Arch }}' - format: tar.gz - format_overrides: - - goos: windows - format: zip - files: - - none* + - id: govc + goos: &goos-defs + - linux + - darwin + - windows + - freebsd + goarch: &goarch-defs + - amd64 + - arm + - arm64 + - mips64le + env: + - CGO_ENABLED=0 + - PKGPATH=github.com/vmware/govmomi/govc/flags + main: ./govc/main.go + binary: govc + ldflags: + - "-X {{.Env.PKGPATH}}.BuildVersion={{.Version}} -X {{.Env.PKGPATH}}.BuildCommit={{.ShortCommit}} -X {{.Env.PKGPATH}}.BuildDate={{.Date}}" + - id: vcsim + goos: *goos-defs + goarch: *goarch-defs + env: + - CGO_ENABLED=0 + main: ./vcsim/main.go + binary: vcsim + ldflags: + - "-X main.buildVersion={{.Version}} -X main.buildCommit={{.ShortCommit}} -X main.buildDate={{.Date}}" + +archives: + - id: govcbuild + builds: + - govc + name_template: "govc_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" + replacements: &replacements + darwin: Darwin + linux: Linux + windows: Windows + freebsd: FreeBSD + amd64: x86_64 + format_overrides: &overrides + - goos: windows + format: zip + files: &extrafiles + - CHANGELOG.md + - LICENSE.txt + - README.md + + - id: vcsimbuild + builds: + - vcsim + name_template: "vcsim_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}" + replacements: *replacements + format_overrides: *overrides + files: *extrafiles + +snapshot: + name_template: "{{ .Tag }}-next" + checksum: - name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' + name_template: "checksums.txt" + changelog: sort: asc filters: exclude: - - '^docs:' - - '^test:' + - "^docs:" + - "^test:" - Merge pull request - Merge branch -brew: - github: - owner: govmomi - name: homebrew-tap - commit_author: - name: Alfred the Narwhal - email: cna-alfred@vmware.com - folder: Formula - homepage: "https://github.com/vmware/govmomi/blob/master/govc/README.md" - description: "govc is a vSphere CLI built on top of govmomi." - test: | - system "#{bin}/govc version" + +# upload disabled since it is maintained in homebrew-core +brews: + - name: govc + ids: + - govcbuild + tap: + owner: govmomi + name: homebrew-tap + # TODO: create token in specified tap repo, add as secret to govmomi repo and reference in release workflow + # token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" + # enable once we do fully automated releases + skip_upload: true + commit_author: + name: Alfred the Narwhal + email: cna-alfred@vmware.com + folder: Formula + homepage: "https://github.com/vmware/govmomi/blob/master/govc/README.md" + description: "govc is a vSphere CLI built on top of govmomi." + test: | + system "#{bin}/govc version" + install: | + bin.install "govc" + - name: vcsim + ids: + - vcsimbuild + tap: + owner: govmomi + name: homebrew-tap + # TODO: create token in specified tap repo, add as secret to govmomi repo and reference in release workflow + # token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" + # enable once we do fully automated releases + skip_upload: true + commit_author: + name: Alfred the Narwhal + email: cna-alfred@vmware.com + folder: Formula + homepage: "https://github.com/vmware/govmomi/blob/master/vcsim/README.md" + description: "vcsim is a vSphere API simulator built on top of govmomi." + test: | + system "#{bin}/vcsim -h" + install: | + bin.install "vcsim" + dockers: - - image: vmware/govc - goos: linux - goarch: amd64 - binary: govc - tag_templates: - - "{{ .Tag }}" - - "v{{ .Major }}" - - "v{{ .Major }}.{{ .Minor }}" - - latest + - image_templates: + - "vmware/govc:{{ .Tag }}" + - "vmware/govc:{{ .ShortCommit }}" + - "vmware/govc:latest" + dockerfile: Dockerfile.govc + ids: + - govc + build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + - "--label=org.opencontainers.image.url=https://github.com/vmware/govmomi" + - "--platform=linux/amd64" + - image_templates: + - "vmware/vcsim:{{ .Tag }}" + - "vmware/vcsim:{{ .ShortCommit }}" + - "vmware/vcsim:latest" + dockerfile: Dockerfile.vcsim + ids: + - vcsim + build_flag_templates: + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + - "--label=org.opencontainers.image.url=https://github.com/vmware/govmomi" + - "--platform=linux/amd64" diff --git a/vendor/github.com/vmware/govmomi/.mailmap b/vendor/github.com/vmware/govmomi/.mailmap index b26a72479c8..23392c16100 100644 --- a/vendor/github.com/vmware/govmomi/.mailmap +++ b/vendor/github.com/vmware/govmomi/.mailmap @@ -1,28 +1,45 @@ +amanpaha amanpaha <84718160+amanpaha@users.noreply.github.com> +Amanda H. L. de Andrade Amanda Hager Lopes de Andrade Katz Amanda H. L. de Andrade amandahla Amit Bathla -Andrew Kutz akutz Andrew Kutz +Andrew Kutz akutz Andrew Kutz Andrew Kutz <101085+akutz@users.noreply.github.com> +Anfernee Yongkun Gui +Anfernee Yongkun Gui Yongkun Anfernee Gui +Anna Carrigan Anna +Balu Dontu BaluDontu Bruce Downs -Bruce Downs Bruce Downs +Bruce Downs Clint Greenwood Cédric Blomart Cédric Blomart cedric David Stark +Doug MacEachern dougm Eric Gray Eric Yutao eric Fabio Rapposelli +Faiyaz Ahmed Faiyaz Ahmed +Faiyaz Ahmed Faiyaz Ahmed +Faiyaz Ahmed Faiyaz Ahmed Henrik Hodne +Ian Eyberg Jeremy Canady +Jiatong Wang jiatongw +Lintong Jiang lintongj <55512168+lintongj@users.noreply.github.com> +Michael Gasch Michael Gasch +Mincho Tonev matonev <31008054+matonev@users.noreply.github.com> +Parveen Chahal Pieter Noordhuis +Saad Malik Takaaki Furukawa takaaki.furukawa Takaaki Furukawa tkak -Vadim Egorov -Anfernee Yongkun Gui -Anfernee Yongkun Gui Yongkun Anfernee Gui -Zach Tucker -Zee Yang -Jiatong Wang jiatongw Uwe Bessle Uwe Bessle Uwe Bessle Uwe Bessle +Vadim Egorov +William Lam +Yun Zhou <41678287+gh05tn0va@users.noreply.github.com> +Zach G zach96guan +Zach Tucker +Zee Yang diff --git a/vendor/github.com/vmware/govmomi/.travis.yml b/vendor/github.com/vmware/govmomi/.travis.yml deleted file mode 100644 index 34777d48dec..00000000000 --- a/vendor/github.com/vmware/govmomi/.travis.yml +++ /dev/null @@ -1,95 +0,0 @@ -# Use the newer Travis-CI build templates based on the -# Debian Linux distribution "Trusty" release. -os: linux -dist: trusty - -# Disable sudo for all builds by default. This ensures all jobs use -# Travis-CI's containerized build environment unless specified otherwise. -# The container builds have *much* shorter queue times than the VM-based -# build environment on which the sudo builds depend. -sudo: false -services: false - -# Set the version of Go. -language: go -go: 1.11 - -# Always set the project's Go import path to ensure that forked -# builds get cloned to the correct location. -go_import_path: github.com/vmware/govmomi - -# Ensure all the jobs know where the temp directory is. -env: - global: TMPDIR=/tmp - -jobs: - include: - - # The "lint" stage runs the various linters against the project. - - &lint-stage - stage: lint - env: LINTER=govet - install: true - script: make "${LINTER}" - - - <<: *lint-stage - env: LINTER=goimports - - # The "build" stage verifies the program can be built against the - # various GOOS and GOARCH combinations found in the Go releaser - # config file, ".goreleaser.yml". - - &build-stage - stage: build - env: GOOS=linux GOARCH=amd64 - install: true - script: make install - - - <<: *build-stage - env: GOOS=linux GOARCH=386 - - - <<: *build-stage - env: GOOS=darwin GOARCH=amd64 - - <<: *build-stage - env: GOOS=darwin GOARCH=386 - - - <<: *build-stage - env: GOOS=freebsd GOARCH=amd64 - - <<: *build-stage - env: GOOS=freebsd GOARCH=386 - - - <<: *build-stage - env: GOOS=windows GOARCH=amd64 - - <<: *build-stage - env: GOOS=windows GOARCH=386 - - # The test stage executes the test target. - - stage: test - install: true - script: make test - - # The deploy stage deploys the build artifacts using goreleaser. - # - # This stage will only be activated when there is an annotated tag present - # or when the text "/ci-deploy" is present in the commit message. However, - # the "deploy" phase of the build will still only be executed on non-PR - # builds as that restriction is baked into Travis-CI. - # - # Finally, this stage requires the Travis-CI VM infrastructure in order to - # leverage Docker. This will increase the amount of time the jobs sit - # in the queue, waiting to be built. However, it's a necessity as Travis-CI - # only allows the use of Docker with VM builds. - - stage: deploy - if: tag IS present OR commit_message =~ /\/ci-deploy/ - sudo: required - services: docker - install: true - script: make install - after_success: docker login -u="${DOCKER_USERNAME}" -p="${DOCKER_PASSWORD}" - deploy: - - provider: script - skip_cleanup: true - script: curl -sL http://git.io/goreleaser | bash - addons: - apt: - update: true - packages: xmlstarlet diff --git a/vendor/github.com/vmware/govmomi/CHANGELOG.md b/vendor/github.com/vmware/govmomi/CHANGELOG.md index 97907f7969e..974881f9892 100644 --- a/vendor/github.com/vmware/govmomi/CHANGELOG.md +++ b/vendor/github.com/vmware/govmomi/CHANGELOG.md @@ -1,331 +1,3515 @@ -# changelog -### 0.20.0 (2018-02-06) + +## [Release v0.29.0](https://github.com/vmware/govmomi/compare/v0.28.0...v0.29.0) + +> Release Date: 2022-07-06 + +### 🐞 Fix + +- [d6dd8fb3] Typos in vim25/soap/client CA tests +- [e086dfe4] generate negative device key in AssignController +- [371a24a4] Interface conversion panic in pkg simulator +- [a982c033] use correct controlflag for vslm SetControlFlags API test +- [37b3b24c] avoid possible panic in govc metric commands +- [310516e2] govc: disambiguate vm/host search flags in vm.migrate +- [6af2cdc3] govc-tests in Go v1.18 +- [142cdca4] Security update golangci-lint +- [971079ba] use correct vcenter.DeploymentSpec.VmConfigSpec json tag + +### 💫 API Changes + +- [e6b5974a] Add versioned user-agent header +- [ca7ee510] add VmConfigSpec field to content library DeploymentSpec + +### 💫 `govc` (CLI) + +- [515ca29f] Use unique searchFlagKey when calling NewSearchFlag +- [9d4ca658] add library.deploy '-config' flag +- [fc17df08] add 'device.clock.add' command +- [11f2d453] Edit disk storage IO + +### 💫 `vcsim` (Simulator) + +- [a1a36c9a] Fix disk capacity fields in ReconfigVM_Task +- [361c90ca] Remove VM Guest.Net entry when removing Ethernet card +- [578b95e5] Fix createVM to encode VM name +- [3325da0c] add content library VmConfigSpec support +- [8928a489] Update Dockerfile + +### 📃 Documentation + +- [5f5fb51e] Fix broken link in PR template + +### 🧹 Chore + +- [69ac8494] Update version.go for v0.29.0 +- [80489cb5] Update release automation +- [e1f76e37] Add missing copyright header +- [6ed812fe] Add Go boilerplate check + +### ⚠️ BREAKING + +### 📖 Commits + +- [69ac8494] chore: Update version.go for v0.29.0 +- [7d3b2b39] Update generated types +- [a1a36c9a] vcsim: Fix disk capacity fields in ReconfigVM_Task +- [5f5fb51e] docs: Fix broken link in PR template +- [d6dd8fb3] fix: Typos in vim25/soap/client CA tests +- [e086dfe4] fix: generate negative device key in AssignController +- [361c90ca] vcsim: Remove VM Guest.Net entry when removing Ethernet card +- [80489cb5] chore: Update release automation +- [e6b5974a] api: Add versioned user-agent header +- [578b95e5] vcsim: Fix createVM to encode VM name +- [371a24a4] fix: Interface conversion panic in pkg simulator +- [a982c033] fix: use correct controlflag for vslm SetControlFlags API test +- [37b3b24c] fix: avoid possible panic in govc metric commands +- [310516e2] fix: govc: disambiguate vm/host search flags in vm.migrate +- [5929abfb] correct SetControlFlags and ClearControlFlags APIs +- [6af2cdc3] fix: govc-tests in Go v1.18 +- [e1f76e37] chore: Add missing copyright header +- [6ed812fe] chore: Add Go boilerplate check +- [142cdca4] fix: Security update golangci-lint +- [3f4993d4] build(deps): bump chuhlomin/render-template from 1.4 to 1.5 +- [971079ba] fix: use correct vcenter.DeploymentSpec.VmConfigSpec json tag +- [892dcfcc] build(deps): bump nokogiri from 1.13.5 to 1.13.6 in /gen +- [303f0d95] build(deps): bump goreleaser/goreleaser-action from 2 to 3 +- [7eef76c3] build(deps): bump nokogiri from 1.13.4 to 1.13.5 in /gen +- [515ca29f] govc: Use unique searchFlagKey when calling NewSearchFlag +- [9d4ca658] govc: add library.deploy '-config' flag +- [c5ebd552] fix:fail to add ssd disk into allflash disk group Closes: [#2846](https://github.com/vmware/govmomi/issues/2846) +- [88f48e02] Updated USAGE.md +- [3325da0c] vcsim: add content library VmConfigSpec support +- [ca7ee510] api: add VmConfigSpec field to content library DeploymentSpec +- [8928a489] vcsim: Update Dockerfile +- [bf5d054d] Fixed docs for govc library.info w/-json +- [2f9fab55] emacs: fix json mode +- [fc17df08] govc: add 'device.clock.add' command +- [11f2d453] govc: Edit disk storage IO + + +## [Release v0.28.0](https://github.com/vmware/govmomi/compare/v0.27.5...v0.28.0) + +> Release Date: 2022-04-27 + +### 🐞 Fix + +- [5ef4aaaf] DiskFileOperation must consider both capacity fields +- [3566a35d] govc guest validate username/password +- [bbbfd7bc] govc test workflow cp error +- [a587742b] avoid debug trace if http.Request.Body is nil +- [7e2ce135] Ignore concurrent deletes in GetCategories +- [a7c6f15b] Allow go 1.17 to go install +- [0f0201ad] vapi - special param encoding for edge cluster lookup +- [e5209e34] rest.Client.LoginByToken invalid signature +- [ad66761e] support govc import.spec for remote ova +- [ebeaa71b] Add IPv6 support for signing HTTP request +- [512c168e] govc vm.destroy only destroys the 1st argument +- [d25aba08] govc vcsa.net.proxy.info doesnt give output in json format +- [ac7c9bf9] avoid possible panic in HostSystem.ManagementIPs +- [10fec668] CHANGELOG sorting and generation + +### 💡 Examples + +- [c5826b8f] Add Alarm Manager Example +- [9617bded] add HostConfigManager_OptionManager +- [a1a9d848] add VirtualDeviceList_SelectByBackingInfo + +### 💫 API Changes + +- [61c40001] add GPU support to VirtualDeviceList.SelectByBackingInfo + +### 💫 `govc` (CLI) + +- [d8dd7f2b] Add CLI command cluster.module +- [49a83e71] Fix arguments validation in datastore.disk.inflate/shrink +- [01d31b53] Add Feature dvs.create '-num-uplinks' flag +- [40e6cbc8] Add Appliance access API +- [949ef572] Add Appliance shutdown API's +- [d5ed6855] Add support for VM hardware upgrade scheduling +- [742f2893] add support for supervisor services deploy +- [3ba25d70] Require full or absolute paths +- [a4ae62e7] Add library info command +- [8fde8bce] validate library.deploy arguments + +### 💫 `vcsim` (Simulator) + +- [3d8ddf16] Fix device connectivity when vm is powered off +- [111ad9fc] Use new action type in simulator PlaceVmsXCluster response +- [e92db045] Fix NFS datastore moid collision +- [16e6bace] set summary.guest.{hostName,ipAddress} in CustomizeVM +- [46a85642] add ssoadmin simulator +- [811b829c] Fix port filtering by criteria in FetchDVPorts +- [e8425be5] revert vapi.Status() method +- [451ec35a] Fix keys in DistributedVirtualPorts +- [6542ccb5] Fix CreateFolder to encode folder name +- [8629c499] Allow updating custom fields +- [93c2afd1] copy device list when cloning a VM +- [3214d97a] add support for cloning HostSystems +- [9b3d6353] Fix distribute VMs across resource pools +- [93d39917] Add TenantManager support in simulator +- [6de12ab7] allow VM PowerOff when Host is in maintenance mode +- [48f7a881] emit VmMigratedEvent in RelocateVM method + +### 📃 Documentation + +- [9ea287c2] Update documentation +- [b4a2d3b3] Add git blog post to CONTRIBUTING +- [c7e103e7] Clarify squash in CONTRIBUTING +- [9317bdaf] Update CONTIRBUTING.md file + +### 🧹 Chore + +- [d60b21d5] Optimize Go CI workflows +- [2d72f576] Add dependabot configuration +- [5c301091] Use powerclicore on ghcr.io +- [7d8af1e7] Update CI to Go 1.18 +- [205c0e0d] Add api: commit prefix +- [b6cd7c1b] Add link to Discussions in New Issue +- [15efe49f] Replace /rest with /api in vcsa.shutdown API's +- [db7edbf4] Update workflow Go versions +- [05c28f4a] upgrade go directive in go.mod to 1.17 +- [ebff29b7] Add notes to PR RELEASE workflow + +### ⚠️ BREAKING + +Fix distribute VMs across resource pools [9b3d6353]: +The name of virtual machines deployed in `vcsim` in a cluster (and +optionally child resource pools) has changed to include the +corresponding resource pool name. VM names deployed to standalone hosts +in `vcsim` are not changed. + +### 📖 Commits + +- [9ea287c2] docs: Update documentation +- [89ae0933] build(deps): bump actions/stale from 3 to 5 +- [d60b21d5] chore: Optimize Go CI workflows +- [0d1b4189] build(deps): bump peter-evans/create-or-update-comment from 1 to 2 +- [e85b164d] build(deps): bump github/codeql-action from 1 to 2 +- [5ef4aaaf] fix: DiskFileOperation must consider both capacity fields +- [3566a35d] fix: govc guest validate username/password +- [1f0f8cc8] build(deps): bump chuhlomin/render-template from 1.2 to 1.4 +- [7324f647] build(deps): bump actions/upload-artifact from 2 to 3 +- [808a439a] build(deps): bump peter-evans/create-pull-request from 3 to 4 +- [bdee9992] build(deps): bump github.com/google/uuid from 1.2.0 to 1.3.0 +- [2d72f576] chore: Add dependabot configuration +- [bbbfd7bc] fix: govc test workflow cp error +- [d8dd7f2b] govc: Add CLI command cluster.module +- [90c90a0a] build(deps): bump nokogiri from 1.13.2 to 1.13.4 in /gen +- [3cb3eff1] ConfigInfo2ConfigSpec +- [3d8ddf16] vcsim: Fix device connectivity when vm is powered off +- [b4a2d3b3] docs: Add git blog post to CONTRIBUTING +- [49a83e71] govc: Fix arguments validation in datastore.disk.inflate/shrink +- [5c301091] chore: Use powerclicore on ghcr.io +- [7d8af1e7] chore: Update CI to Go 1.18 +- [111ad9fc] vcsim: Use new action type in simulator PlaceVmsXCluster response +- [c5826b8f] examples: Add Alarm Manager Example +- [46583051] Move the ClusterClusterInitialPlacementAction to unreleased types + fix linter error +- [9b1de9c8] Fix a linter error +- [cb2b8f5c] Add a new type of cluster action used for placing a VM. This action inherits from InitialPlacement action because it conveys the resource pool and host for placing the VM. In addition, it also has the VM's ConfigSpecwhich is used for indicating the recommended datastore for each virtual disk in VM's ConfigSpec +- [9617bded] examples: add HostConfigManager_OptionManager +- [8e4054fa] adding a check that number of uplinks otherwise do default +- [aada9aa1] Reconfigure LACP API for DVS +- [a1a9d848] examples: add VirtualDeviceList_SelectByBackingInfo +- [61c40001] api: add GPU support to VirtualDeviceList.SelectByBackingInfo +- [e92db045] vcsim: Fix NFS datastore moid collision +- [01d31b53] govc: Add Feature dvs.create '-num-uplinks' flag +- [11e469a4] build(deps): bump nokogiri from 1.12.5 to 1.13.2 in /gen +- [547c63fd] Added Support for vrdma NIC Type Signed-off-by: C S P Nanda +- [205c0e0d] chore: Add api: commit prefix +- [b6cd7c1b] chore: Add link to Discussions in New Issue +- [15efe49f] chore: Replace /rest with /api in vcsa.shutdown API's +- [40e6cbc8] govc: Add Appliance access API +- [16e6bace] vcsim: set summary.guest.{hostName,ipAddress} in CustomizeVM +- [a587742b] fix: avoid debug trace if http.Request.Body is nil +- [7e2ce135] fix: Ignore concurrent deletes in GetCategories +- [1875bac1] Add PlaceVmsXCluster bindings and simulator +- [a7c6f15b] fix: Allow go 1.17 to go install +- [a5498b89] Add BackingDiskObjectId go bindings to CNS API +- [0f0201ad] fix: vapi - special param encoding for edge cluster lookup +- [46a85642] vcsim: add ssoadmin simulator +- [297a3cae] ssoadmin: add IdentitySources API bindings +- [811b829c] vcsim: Fix port filtering by criteria in FetchDVPorts +- [e5209e34] fix: rest.Client.LoginByToken invalid signature +- [c7e103e7] docs: Clarify squash in CONTRIBUTING +- [e8425be5] vcsim: revert vapi.Status() method +- [ad66761e] fix: support govc import.spec for remote ova +- [803b6362] sts: support issuing HoK token using HoK token +- [451ec35a] vcsim: Fix keys in DistributedVirtualPorts +- [949ef572] govc: Add Appliance shutdown API's +- [6542ccb5] vcsim: Fix CreateFolder to encode folder name +- [d5ed6855] govc: Add support for VM hardware upgrade scheduling +- [9317bdaf] docs: Update CONTIRBUTING.md file +- [8629c499] vcsim: Allow updating custom fields +- [93c2afd1] vcsim: copy device list when cloning a VM +- [ebeaa71b] fix: Add IPv6 support for signing HTTP request +- [b729a862] Fix typo in (simulator.Context).WithLock() comment +- [cd577f46] Fixed doc +- [ca1f45ae] Added command flag documentation +- [512240a0] Fixed goimports issues +- [ce88635f] Added vm::ExportSnapshot and snapshot flag to export.ovf +- [742f2893] govc: add support for supervisor services deploy +- [3214d97a] vcsim: add support for cloning HostSystems +- [3ba25d70] govc: Require full or absolute paths +- [db7edbf4] chore: Update workflow Go versions +- [512c168e] fix: govc vm.destroy only destroys the 1st argument +- [b51418e3] Add IsAlreadyExists error helper +- [05c28f4a] chore: upgrade go directive in go.mod to 1.17 +- [a4ae62e7] govc: Add library info command +- [d25aba08] fix: govc vcsa.net.proxy.info doesnt give output in json format +- [ac7c9bf9] fix: avoid possible panic in HostSystem.ManagementIPs +- [9b3d6353] vcsim: Fix distribute VMs across resource pools +- [1da8c5e8] Fix: Deep compare error types in simulator VM tests +- [d3eaa9b9] Support Creating/Reconfiguring a simulator VM with VApp properties +- [10fec668] fix: CHANGELOG sorting and generation +- [b05ed4e0] Independent simulator.Context per-subtask in PowerOnMultiVM. +- [a0224d91] Fix eam/simulator tests +- [e2498fb8] Change references from global Map to ctx.Map. +- [ab446838] Set the Context.Map's when global Map is set +- [3b86fd0c] Re-work TenantManager addition to ServiceContent for older clients +- [93d39917] vcsim: Add TenantManager support in simulator +- [9f737e00] fix updating stale url from Makefile +- [8fde8bce] govc: validate library.deploy arguments +- [6de12ab7] vcsim: allow VM PowerOff when Host is in maintenance mode +- [ebff29b7] chore: Add notes to PR RELEASE workflow +- [48f7a881] vcsim: emit VmMigratedEvent in RelocateVM method +- [bb4f739b] Support finding Portgroups by ID in Finder.Network + + +## [Release v0.27.5](https://github.com/vmware/govmomi/compare/v0.27.4...v0.27.5) + +> Release Date: 2022-06-02 + +### 🐞 Fix + +- [e97c9708] use correct controlflag for vslm SetControlFlags API test + +### ⚠️ BREAKING + +### 📖 Commits + +- [e97c9708] fix: use correct controlflag for vslm SetControlFlags API test +- [f8cf9ef7] correct SetControlFlags and ClearControlFlags APIs + + +## [Release v0.27.4](https://github.com/vmware/govmomi/compare/v0.27.3...v0.27.4) + +> Release Date: 2022-02-10 + +### 🐞 Fix + +- [285e80cd] avoid debug trace if http.Request.Body is nil +- [dde50904] Ignore concurrent deletes in GetCategories +- [cbc68fc0] rest.Client.LoginByToken invalid signature + +### 💫 `vcsim` (Simulator) + +- [df595d82] add ssoadmin simulator -* Add vslm package for managing First Class Disks +### ⚠️ BREAKING -* Add LoginByToken to session KeepAliveHandler +### 📖 Commits -### 0.19.0 (2018-09-30) +- [285e80cd] fix: avoid debug trace if http.Request.Body is nil +- [dde50904] fix: Ignore concurrent deletes in GetCategories +- [fc1fce62] Add PlaceVmsXCluster bindings and simulator +- [df595d82] vcsim: add ssoadmin simulator +- [9ca477aa] ssoadmin: add IdentitySources API bindings +- [24fe60f1] Add BackingDiskObjectId go bindings to CNS API +- [cbc68fc0] fix: rest.Client.LoginByToken invalid signature -* New vapi/rest and and vapi/tags packages + +## [Release v0.27.3](https://github.com/vmware/govmomi/compare/v0.27.2...v0.27.3) -* Allowing the use of STS for exchanging tokens +> Release Date: 2022-02-01 -* Add object.VirtualMachine.UUID method +### 🐞 Fix -* SetRootCAs on the soap.Client returns an error for invalid certificates +- [2d7cd133] Add IPv6 support for signing HTTP request -* Add ClusterComputeResource.MoveInto method +### ⚠️ BREAKING -### 0.18.0 (2018-05-24) +### 📖 Commits -* Add VirtualDiskManager wrapper to set UUID +- [6b4e2391] sts: support issuing HoK token using HoK token +- [2d7cd133] fix: Add IPv6 support for signing HTTP request -* Add vmxnet2, pcnet32 and sriov to VirtualDeviceList.EthernetCardTypes + +## [Release v0.27.2](https://github.com/vmware/govmomi/compare/v0.27.1...v0.27.2) -* Add new vSphere 6.7 APIs +> Release Date: 2021-11-23 -* Decrease LoginExtensionByCertificate tunnel usage +### 🐞 Fix -* SAML token authentication support via SessionManager.LoginByToken +- [f04d77d6] avoid possible panic in HostSystem.ManagementIPs -* New SSO admin client for managing users +### ⚠️ BREAKING -* New STS client for issuing and renewing SAML tokens +### 📖 Commits -* New Lookup Service client for discovering endpoints such as STS and ssoadmin +- [f04d77d6] fix: avoid possible panic in HostSystem.ManagementIPs -* Switch from gvt to go dep for managing dependencies + +## [Release v0.27.1](https://github.com/vmware/govmomi/compare/v0.27.0...v0.27.1) -### 0.17.1 (2018-03-19) +> Release Date: 2021-10-20 -* vcsim: add Destroy method for Folder and Datacenter types +### ⚠️ BREAKING -* In progress.Reader emit final report on EOF. +### 📖 Commits -* vcsim: add EventManager.QueryEvents +- [6209be5b] Support finding Portgroups by ID in Finder.Network -### 0.17.0 (2018-02-28) + +## [Release v0.27.0](https://github.com/vmware/govmomi/compare/v0.26.2...v0.27.0) -* Add HostStorageSystem.AttachScsiLun method +> Release Date: 2021-10-14 -* Avoid possible panic in Datastore.Stat (#969) +### 🐞 Fix -* Destroy event history collectors (#962) +- [57c4be58] multi-value query params for vAPI methods +- [815e2d8f] avoid vNIC mapping in guest.TransferURL if URL.Host is an IP +- [81a7dbe9] avoid use of vNIC IP in guest.TransferURL if there are multiple +- [61afce31] Update CnsQueryAsync API request parameters to handle nil for QuerySelection +- [a601a8a8] generate negative device key -* Add VirtualDiskManager.CreateChildDisk method +### 💫 `govc` (CLI) -### 0.16.0 (2017-11-08) +- [b5426eba] Add feature to read file contents for ExtraConfig +- [85956c77] fix tasks to activate option dump/json/xml +- [f4ef4d93] Fix incorrect MoRef parsing +- [d695f4cf] Handle powered on VMs in vm.destroy +- [94f63681] add library.clone '-e' and '-m' options +- [2fcae372] add vsan info and change commands -* Add support for SOAP request operation ID header +### 💫 `vcsim` (Simulator) -* Moved ovf helpers from govc import.ovf command to ovf and nfc packages +- [fa457940] Fix PowerOnMultiVMTask() to return per-VM tasks +- [e67b1b11] check if VM host InMaintenanceMode -* Added guest/toolbox (client) package +### 📃 Documentation -* Added toolbox package and toolbox command +- [82e447d9] Update govc USAGE -* Added simulator package and vcsim command +### 🧹 Chore -### 0.15.0 (2017-06-19) +- [05adcc97] Remove -i parameter in go install +- [18ea9cc5] Update PR and release docs -* WaitOptions.MaxWaitSeconds is now optional +### ⚠️ BREAKING -* Support removal of ExtraConfig entries +Add task manager and collector [397c8aad]: +`event.Manager` does not embed `object.Common` anymore. Only the methods +`Client()` and `Reference()` are implemented. +`event.NewHistoryCollector()` is now unexported (to +`newHistoryCollector()`) as it was merely a helper and to comply with +the task manager implementation. -* GuestPosixFileAttributes OwnerId and GroupId fields are now pointers, - rather than omitempty ints to allow chown with root uid:gid +### 📖 Commits -* Updated examples/ using view package +- [78f30265] update contributors +- [68b54585] Refactor EAM code to use BaseAgencyConfigInfo interface instead of impl +- [d5ded1f0] Implement mo.Reference interface in task+event managers +- [038bc3d8] Update vslm types to vCenter 7.0U3 (build 18700403) +- [ae8161df] Update pbm types to vCenter 7.0U3 (build 18700403) +- [f2d167de] Update eam types to vCenter 7.0U3 (build 18700403) +- [f1c7b54d] Update vim25 types to vCenter 7.0U3 (build 18700403) +- [445fd552] Update gen.sh to vCenter 7.0U3 (build 18700403) +- [961f0ae6] example: find VirtualMachine's Cluster +- [57c4be58] fix: multi-value query params for vAPI methods +- [f7e8ed73] Set custom HTTP headers for VAPI calls +- [05adcc97] chore: Remove -i parameter in go install +- [82e447d9] docs: Update govc USAGE +- [b5426eba] govc: Add feature to read file contents for ExtraConfig +- [815e2d8f] fix: avoid vNIC mapping in guest.TransferURL if URL.Host is an IP +- [81a7dbe9] fix: avoid use of vNIC IP in guest.TransferURL if there are multiple +- [18ea9cc5] chore: Update PR and release docs +- [a66d23ed] build(deps): bump nokogiri from 1.11.4 to 1.12.5 in /gen +- [a853b300] Fix: Nil-Pointer Exception in ResourceAllocation +- [fa457940] vcsim: Fix PowerOnMultiVMTask() to return per-VM tasks +- [85956c77] govc: fix tasks to activate option dump/json/xml +- [61afce31] fix: Update CnsQueryAsync API request parameters to handle nil for QuerySelection +- [397c8aad] feat: Add task manager and collector +- [a601a8a8] fix: generate negative device key +- [f4ef4d93] govc: Fix incorrect MoRef parsing +- [e67b1b11] vcsim: check if VM host InMaintenanceMode +- [d695f4cf] govc: Handle powered on VMs in vm.destroy +- [a55fa7dc] feat: Add optional WaitOptions to WaitForUpdates +- [94f63681] govc: add library.clone '-e' and '-m' options +- [2fcae372] govc: add vsan info and change commands -* Add DatastoreFile.TailFunc method + +## [Release v0.26.2](https://github.com/vmware/govmomi/compare/v0.26.1...v0.26.2) -* Export VirtualMachine.FindSnapshot method +> Release Date: 2022-03-21 -* Add AuthorizationManager {Enable,Disable}Methods +### 🐞 Fix -* Add PBM client +- [76a22af3] avoid possible panic in HostSystem.ManagementIPs +- [566d2ac1] avoid use of vNIC IP in guest.TransferURL if there are multiple -### 0.14.0 (2017-04-08) +### ⚠️ BREAKING -* Add view.ContainerView type and methods +### 📖 Commits -* Add Collector.RetrieveWithFilter method +- [76a22af3] fix: avoid possible panic in HostSystem.ManagementIPs +- [566d2ac1] fix: avoid use of vNIC IP in guest.TransferURL if there are multiple -* Add property.Filter type + +## [Release v0.26.1](https://github.com/vmware/govmomi/compare/v0.26.0...v0.26.1) -* Implement EthernetCardBackingInfo for OpaqueNetwork +> Release Date: 2021-08-16 -* Finder: support changing object root in find mode +### 🐞 Fix -* Add VirtualDiskManager.QueryVirtualDiskInfo +- [a366e352] Regenerated interface and type to include BaseAgencyConfigInfo. Closes: [#2545](https://github.com/vmware/govmomi/issues/2545). +- [d66ef551] explicitly import eam/simulator in test -* Add performance.Manager APIs +### 💡 Examples -### 0.13.0 (2017-03-02) +- [0c045a63] Add Property Wait example -* Add DatastoreFileManager API wrapper +### 💫 `govc` (CLI) -* Add HostVsanInternalSystem API wrappers +- [012f5348] support updating items in library.update command +- [5743d5b6] Allow cluster.change to set ClusterDrsConfigInfo.vmotionRate +- [03210c91] Add object.collect type flag alias help -* Add Container support to view package +### 💫 `vcsim` (Simulator) + +- [ce6ed634] avoid race when fetching object Locker +- [31821de3] use 'domain-c' prefix for cluster moids +- [3625e6dd] propagate CustomizeVM MacAddress to Virtual NIC +- [389c0382] Take the host parameter into account while cloning a VM on a cluster +- [6fba1da7] Implement VSLM ExtendDisk_Task + +### 🧹 Chore + +- [ddc2b47a] Include commit details in BREAKING section + +### ⚠️ BREAKING + +### 📖 Commits + +- [a366e352] fix: Regenerated interface and type to include BaseAgencyConfigInfo. Closes: [#2545](https://github.com/vmware/govmomi/issues/2545). +- [655f8e5c] testing for lab +- [ce6ed634] vcsim: avoid race when fetching object Locker +- [31821de3] vcsim: use 'domain-c' prefix for cluster moids +- [0aa1de31] make processing of mac addresses case insensitive ([#2510](https://github.com/vmware/govmomi/issues/2510)) +- [012f5348] govc: support updating items in library.update command +- [0c045a63] examples: Add Property Wait example +- [f30cefc3] Add Reauth flag to skip loading cached sessions +- [3625e6dd] vcsim: propagate CustomizeVM MacAddress to Virtual NIC +- [5743d5b6] govc: Allow cluster.change to set ClusterDrsConfigInfo.vmotionRate +- [389c0382] vcsim: Take the host parameter into account while cloning a VM on a cluster +- [7bf48333] Added CNS querySnapshots binding, simulator testcases and client testcases +- [017ab414] Added CreateSnapshots and DeleteSnapshots methods in cns simulator as well as their test cases +- [03210c91] govc: Add object.collect type flag alias help +- [d66ef551] fix: explicitly import eam/simulator in test +- [ddc2b47a] chore: Include commit details in BREAKING section +- [6fba1da7] vcsim: Implement VSLM ExtendDisk_Task + + +## [Release v0.26.0](https://github.com/vmware/govmomi/compare/v0.25.0...v0.26.0) + +> Release Date: 2021-06-03 + +### 🐞 Fix + +- [70b92d6d] Isolate SSO govc tests + +### 💡 Examples + +- [81b1de17] add toolbox Client.Run + +### 💫 `govc` (CLI) + +- [e37e515b] fix default guest.run path for unsupported Windows guests +- [0e7012d0] Add support for getting the VC proxy and no-proxy configuration ([#2435](https://github.com/vmware/govmomi/issues/2435)) +- [6afb8ff9] Change 'Maintenance Mode' printing in host.info + +### 💫 `vcsim` (Simulator) + +- [dff7f6bb] fix panic in QueryPerfCounter method +- [df9dfde1] set VirtualMachine ChangeTrackingSupported property ([#2468](https://github.com/vmware/govmomi/issues/2468)) +- [0c0ed98a] fix race in CloneVM_Task +- [d01d0fa7] add simulator.RunContainer method +- [8ab0c99a] untie datastore capacity from local fs +- [d31941c8] Modify Usage of README. (based on v0.25.0) +- [4fea687c] include all namespaces in /about info +- [bd3467d4] avoid edit device panic when DeviceInfo is nil +- [35a42af5] add guest operations process support + +### 📃 Documentation + +- [75eee8e4] update govc/USAGE and CONTRIBUTORS +- [1f795d21] Add blog to vcsim README +- [2719c229] Document linker and GOFLAGS for build vars + +### 🧹 Chore + +- [b4e1f965] Fix CONTRIB link in greeting +- [6f2597be] Update CHANGELOG implementation +- [d3944e17] Add and reorder commits in CHANGELOG +- [a796d3fc] Add make help target +- [8bc8fd28] Add issue and PR templates +- [60e33916] Document commit prefixes +- [cac1d8d7] Add issue greeting +- [0f1c3f89] Add WIP Action +- [921ad37a] Remove dep files +- [1d4ce94a] Clean up documentation +- [991278b9] Remove unused release script +- [16d8add5] Automate CHANGELOG + +### ⚠️ BREAKING + +### 📖 Commits + +- [75eee8e4] docs: update govc/USAGE and CONTRIBUTORS +- [dff7f6bb] vcsim: fix panic in QueryPerfCounter method +- [b4e1f965] chore: Fix CONTRIB link in greeting +- [df9dfde1] vcsim: set VirtualMachine ChangeTrackingSupported property ([#2468](https://github.com/vmware/govmomi/issues/2468)) +- [8cbe64c5] Fix: Protect FileProvider.files to avoid concurrent modification +- [6f2597be] chore: Update CHANGELOG implementation +- [0c0ed98a] vcsim: fix race in CloneVM_Task +- [81b1de17] examples: add toolbox Client.Run +- [d01d0fa7] vcsim: add simulator.RunContainer method +- [9223b5ae] Add toolbox.NewClient method +- [8ab0c99a] vcsim: untie datastore capacity from local fs +- [e37e515b] govc: fix default guest.run path for unsupported Windows guests +- [d3944e17] chore: Add and reorder commits in CHANGELOG +- [83e29c69] Update GitHub Test Action to use Makefile +- [a7f2c47e] Update vslm types vC build 17986435 (7.0U2HP4) +- [067374fd] Update sms types vC build 17986435 (7.0U2HP4) +- [d9f507f0] Update pbm types vC build 17986435 (7.0U2HP4) +- [c89f8dd5] Update eam types vC build 17986435 (7.0U2HP4) +- [b72432ef] Update vim25 types vC build 17986435 (7.0U2HP4) +- [e53716dd] Update gen.sh to vC build 17986435 (7.0U2HP4) +- [1f795d21] docs: Add blog to vcsim README +- [338f5529] Ran "make fix" to correct lint issues +- [23d77ba4] Add support for golangci-lint +- [d31941c8] vcsim: Modify Usage of README. (based on v0.25.0) +- [7046a0d3] Support pre-auth handlers in vC Sim +- [2e8860d1] Add CNS Snapshot APIs in govmomi +- [13d4d376] Remove vendor +- [a796d3fc] chore: Add make help target +- [ef824a20] Fix QueryAsyncVolume API test to be invoked only for vSphere 7.0.3 +- [c1900234] Fix data race in simulator.container.id +- [3212351e] install bin doc: permalink to latest version +- [7d779833] Setup CodeQL Analysis +- [566250ff] build(deps): bump nokogiri from 1.11.1 to 1.11.4 in /gen +- [f814a9ca] ESX Agent Manager (EAM) Client and Simulator +- [0e7012d0] govc: Add support for getting the VC proxy and no-proxy configuration ([#2435](https://github.com/vmware/govmomi/issues/2435)) +- [8bc8fd28] chore: Add issue and PR templates +- [4fea687c] vcsim: include all namespaces in /about info +- [bd3467d4] vcsim: avoid edit device panic when DeviceInfo is nil +- [70b92d6d] fix: Isolate SSO govc tests +- [80c9053e] Correcting broken Kubernetes vSphere Cloud Provider links +- [60e33916] chore: Document commit prefixes +- [57a141f3] Update govc test docs with act +- [ff578914] Use "vcsim uuidgen" for bats tests +- [61e12ddb] Only greet unassociated users +- [e39dfdc8] Add chore section to CHANGELOG +- [6afb8ff9] govc: Change 'Maintenance Mode' printing in host.info +- [cac1d8d7] chore: Add issue greeting +- [0f1c3f89] chore: Add WIP Action +- [921ad37a] chore: Remove dep files +- [2719c229] docs: Document linker and GOFLAGS for build vars +- [f3645a96] Clarify SetRootCAs behavior +- [c368e57f] toolbox: add hgfs freebsd stub +- [35a42af5] vcsim: add guest operations process support +- [64e55d81] Set RoundTripper in ssoadmin.NewClient +- [1d4ce94a] chore: Clean up documentation +- [991278b9] chore: Remove unused release script +- [16d8add5] chore: Automate CHANGELOG +- [e8805c92] Add NotFoundFault in cns types +- [8576fe27] Add queryAsyncVolume in simulator +- [4b9e0813] Simplify binary download instructions +- [3062dda9] Remove Travis CI +- [0be5632f] adding rancher to projects and reorganizing in alpha order +- [4a63a28c] Add bindings for CnsQueryAsyncVolume API +- [a8c80b93] Update READMEs with artifacts and Docker images +- [26c9690c] Fix VM Guest test and vet warnings +- [a32cd0b3] Add RELEASE documentation +- [cc660b0e] Increase govc tests timeout +- [d7bfaf4f] toolbox: move process management to its own package +- [e86da96e] Exclude go files in release tarball + + +## [Release v0.25.0](https://github.com/vmware/govmomi/compare/v0.24.2...v0.25.0) + +> Release Date: 2021-04-16 + +### 💡 Examples + +- [38da87ff] add NetworkReference.EthernetCardBackingInfo + +### 💫 `govc` (CLI) + +- [1ac314c3] add vm.customize -dns-suffix flag +- [60e0e895] update test images URL +- [cdf3ace6] log invalid NetworkMapping.Name with import.ova command +- [f8b3d8a8] revert pretty print pruning optimization +- [35481467] add library.update command +- [749c2239] add session.ls -S flag +- [93245c1e] add tree command +- [790f9ce6] include sub task fault messages on failure +- [d2a353ba] remove device.boot -firmware default +- [de6032e0] add '-trace' and '-verbose' flags +- [63bb5c1e] metric command enhancements and fixes +- [7844a8c2] fix vm.migrate search index flags +- [5dacf627] fix cluster.usage Free field +- [f71bcf25] fix session curl when given a URL query +- [c954c2a5] validate license.remove +- [3b25c3f1] validate required library.clone NAME arg +- [344b7a30] note 'disk.ls -R' in volume.rm help +- [8942055a] add device.info examples to get disk UUID and vmdk +- [1b0af949] fix vm.markasvm examples +- [add8be5a] fix incorrect DeviceID value in device.pci.add +- [1f4f5640] add IPv6 support to vm.customize + +### 💫 `vcsim` (Simulator) + +- [27d8d2e4] put verbose logging behind '-trace' flag +- [0ef4ae22] add moid value mapping mappings +- [082f9927] add vsan simulator +- [25970530] fix Task.Info.Entity in RevertToSnapshot_Task +- [f0a045ac] set VirtualMachine.Config.CreateDate property +- [e51eb2b9] support EventFilterSpec.Time +- [8e45fa4a] emit CustomizationSucceeded event from CustomizeVM +- [c000bd6e] add DistributedVirtualSwitchManager +- [bcd5fa87] set VirtualDisk backing UUID +- [ccdcbe89] move product suffix in ServiceContent.About +- [393e7330] use linked list for EventHistoryCollector +- [9c4dc1a1] escape datastore name +- [9c2fe70f] record/replay EnvironmentBrowser.QueryConfigOption +- [5fd7e264] fix EventHistoryCollector fixes +- [0b755a59] switch bats tests from esx to vcsim env +- [3f1caf82] fixes for PowerCLI Get-VirtualNetwork + +### 📃 Documentation + +- [e18b601f] update for 0.25 release + +### ⚠️ BREAKING + +### 📖 Commits + +- [6fe8d60a] Fix folder write for govc container +- [e18b601f] docs: update for 0.25 release +- [1ac314c3] govc: add vm.customize -dns-suffix flag +- [22d911f6] Add Cron Docker Login Action +- [60e0e895] govc: update test images URL +- [3385b3e0] Add action to automate release +- [cdf3ace6] govc: log invalid NetworkMapping.Name with import.ova command +- [27d8d2e4] vcsim: put verbose logging behind '-trace' flag +- [f8b3d8a8] govc: revert pretty print pruning optimization +- [0ef4ae22] vcsim: add moid value mapping mappings +- [df08d4b2] First step towards release automation +- [f9b79a4f] export simulator.task.Wait() +- [917c4ec8] Ensure lock hand-off to simulator.Task goroutine +- [b45b228f] Simulator Task Delay +- [4b59b652] Make Simulator Tasks Async +- [bc52c793] Associate every registry lock with a Context. +- [054971ee] Wait until VM creation completes before adding to folder +- [35481467] govc: add library.update command +- [7403b470] Fix race in simulator's PropertyCollector +- [aadb2082] Add action to block WIP PRs +- [749c2239] govc: add session.ls -S flag +- [bc297330] [3ad0f415] Update Dockerfiles and .goreleaser.yml +- [082f9927] vcsim: add vsan simulator +- [8c38d56d] Add a stretched cluster conversion command. +- [408c531a] gofmt +- [e8a6b126] Update govc/flags/output.go +- [bf54a7c4] Add more badges +- [93245c1e] govc: add tree command +- [790f9ce6] govc: include sub task fault messages on failure +- [07e6e923] Use Github Actions Status Badges +- [d2a353ba] govc: remove device.boot -firmware default +- [4ed615f6] Add chainable RoundTripper support to endpoint clients +- [bab95d26] Add the vSAN stretched cluster reference. +- [6ff33db7] Fix events example +- [de6032e0] govc: add '-trace' and '-verbose' flags +- [7aae8dfb] Add support for calling vCenter for VLSM ExtendDisk and InflateDisk +- [7a276bf6] Add client test file for vslm package to validate register disk and cns create volume +- [dc29aa29] Fix performance.Manager.SampleByName truncation +- [18b53fd2] Added UpdateServiceMessage to Session Manager +- [63bb5c1e] govc: metric command enhancements and fixes +- [7844a8c2] govc: fix vm.migrate search index flags +- [7ab111bd] Drop clusterDistribution from vSAN 7.0 update and create spec elements +- [2c57a8a3] Use Github Actions +- [52631496] Marshal soapFaultError as JSON +- [f9e323a6] fix tab indentation +- [ae129ba0] add tests and implement HA Ready Condition +- [f34b3fa2] implement vSphere HA additional delay to VM HA overrides in govc +- [25970530] vcsim: fix Task.Info.Entity in RevertToSnapshot_Task +- [5dacf627] govc: fix cluster.usage Free field +- [0d155a61] Handling invalid reader size +- [b70542a5] Using progress reader in WriteFile +- [b7f9e034] use correct enum for vm restart priority +- [d3d49a36] Add support for snapshot size calculations +- [61bfa072] Use a dash to indicate empty address +- [f0a045ac] vcsim: set VirtualMachine.Config.CreateDate property +- [4d9a9000] vim25: fix race in TemporaryNetworkError retry func +- [2f14e4b2] ovf: add Config and ExtraConfig to VirtualHardwareSection +- [50328780] Add vSAN 7.0U1 release constant +- [886573de] Update .goreleaser.yml +- [1cdb3164] Change the address type to automatic +- [667a3791] Remove duplicate cns bindings from vsan directory +- [f71bcf25] govc: fix session curl when given a URL query +- [d92f41de] Update volume ACL spec to add delete field +- [c954c2a5] govc: validate license.remove +- [2a4f8c8a] Update ConfigureVolumeACLs bindings in cns types +- [3b25c3f1] govc: validate required library.clone NAME arg +- [344b7a30] govc: note 'disk.ls -R' in volume.rm help +- [8942055a] govc: add device.info examples to get disk UUID and vmdk +- [1b0af949] govc: fix vm.markasvm examples +- [543e52ea] govc-env --save default +- [0a5f2a99] Little fix for "govc-env --save without config name" +- [4a7a0b45] gen: require nokogiri 1.11.0 or higher +- [add8be5a] govc: fix incorrect DeviceID value in device.pci.add +- [e51eb2b9] vcsim: support EventFilterSpec.Time +- [1f4f5640] govc: add IPv6 support to vm.customize +- [8e45fa4a] vcsim: emit CustomizationSucceeded event from CustomizeVM +- [c000bd6e] vcsim: add DistributedVirtualSwitchManager +- [bcd5fa87] vcsim: set VirtualDisk backing UUID +- [ccdcbe89] vcsim: move product suffix in ServiceContent.About +- [393e7330] vcsim: use linked list for EventHistoryCollector +- [9c4dc1a1] vcsim: escape datastore name +- [9c2fe70f] vcsim: record/replay EnvironmentBrowser.QueryConfigOption +- [5fd7e264] vcsim: fix EventHistoryCollector fixes +- [40a2cf0b] Skip tests that require docker on TravisCI +- [00ee2911] toolbox: skip tests that require Linux +- [0b755a59] vcsim: switch bats tests from esx to vcsim env +- [c6d5264a] Updated projects to include VMware Event Broker Appliance +- [ae44a547] ExampleCollector_Retrieve: Add missing err return +- [38da87ff] examples: add NetworkReference.EthernetCardBackingInfo +- [3f1caf82] vcsim: fixes for PowerCLI Get-VirtualNetwork +- [041a98b8] Fix DvsNetworkRuleQualifier interface +- [44e05fe4] SHA-1 deprecated in 2011, sha256sum for releases + + +## [Release v0.24.2](https://github.com/vmware/govmomi/compare/v0.24.1...v0.24.2) + +> Release Date: 2021-10-14 + +### 🐞 Fix + +- [b18f06b5] avoid vNIC mapping in guest.TransferURL if URL.Host is an IP +- [5a2a8aba] avoid use of vNIC IP in guest.TransferURL if there are multiple + +### ⚠️ BREAKING + +### 📖 Commits + +- [b18f06b5] fix: avoid vNIC mapping in guest.TransferURL if URL.Host is an IP +- [5a2a8aba] fix: avoid use of vNIC IP in guest.TransferURL if there are multiple + + +## [Release v0.24.1](https://github.com/vmware/govmomi/compare/v0.24.0...v0.24.1) + +> Release Date: 2021-03-17 + +### 💡 Examples + +- [38da87ff] add NetworkReference.EthernetCardBackingInfo + +### 💫 `govc` (CLI) + +- [63bb5c1e] metric command enhancements and fixes +- [7844a8c2] fix vm.migrate search index flags +- [5dacf627] fix cluster.usage Free field +- [f71bcf25] fix session curl when given a URL query +- [c954c2a5] validate license.remove +- [3b25c3f1] validate required library.clone NAME arg +- [344b7a30] note 'disk.ls -R' in volume.rm help +- [8942055a] add device.info examples to get disk UUID and vmdk +- [1b0af949] fix vm.markasvm examples +- [add8be5a] fix incorrect DeviceID value in device.pci.add +- [1f4f5640] add IPv6 support to vm.customize + +### 💫 `vcsim` (Simulator) + +- [25970530] fix Task.Info.Entity in RevertToSnapshot_Task +- [f0a045ac] set VirtualMachine.Config.CreateDate property +- [e51eb2b9] support EventFilterSpec.Time +- [8e45fa4a] emit CustomizationSucceeded event from CustomizeVM +- [c000bd6e] add DistributedVirtualSwitchManager +- [bcd5fa87] set VirtualDisk backing UUID +- [ccdcbe89] move product suffix in ServiceContent.About +- [393e7330] use linked list for EventHistoryCollector +- [9c4dc1a1] escape datastore name +- [9c2fe70f] record/replay EnvironmentBrowser.QueryConfigOption +- [5fd7e264] fix EventHistoryCollector fixes +- [0b755a59] switch bats tests from esx to vcsim env +- [3f1caf82] fixes for PowerCLI Get-VirtualNetwork + +### ⚠️ BREAKING + +### 📖 Commits + +- [7a276bf6] Add client test file for vslm package to validate register disk and cns create volume +- [dc29aa29] Fix performance.Manager.SampleByName truncation +- [18b53fd2] Added UpdateServiceMessage to Session Manager +- [63bb5c1e] govc: metric command enhancements and fixes +- [7844a8c2] govc: fix vm.migrate search index flags +- [7ab111bd] Drop clusterDistribution from vSAN 7.0 update and create spec elements +- [52631496] Marshal soapFaultError as JSON +- [f9e323a6] fix tab indentation +- [ae129ba0] add tests and implement HA Ready Condition +- [f34b3fa2] implement vSphere HA additional delay to VM HA overrides in govc +- [25970530] vcsim: fix Task.Info.Entity in RevertToSnapshot_Task +- [5dacf627] govc: fix cluster.usage Free field +- [b7f9e034] use correct enum for vm restart priority +- [d3d49a36] Add support for snapshot size calculations +- [61bfa072] Use a dash to indicate empty address +- [f0a045ac] vcsim: set VirtualMachine.Config.CreateDate property +- [4d9a9000] vim25: fix race in TemporaryNetworkError retry func +- [2f14e4b2] ovf: add Config and ExtraConfig to VirtualHardwareSection +- [50328780] Add vSAN 7.0U1 release constant +- [886573de] Update .goreleaser.yml +- [1cdb3164] Change the address type to automatic +- [667a3791] Remove duplicate cns bindings from vsan directory +- [f71bcf25] govc: fix session curl when given a URL query +- [d92f41de] Update volume ACL spec to add delete field +- [c954c2a5] govc: validate license.remove +- [2a4f8c8a] Update ConfigureVolumeACLs bindings in cns types +- [3b25c3f1] govc: validate required library.clone NAME arg +- [344b7a30] govc: note 'disk.ls -R' in volume.rm help +- [8942055a] govc: add device.info examples to get disk UUID and vmdk +- [1b0af949] govc: fix vm.markasvm examples +- [543e52ea] govc-env --save default +- [0a5f2a99] Little fix for "govc-env --save without config name" +- [4a7a0b45] gen: require nokogiri 1.11.0 or higher +- [add8be5a] govc: fix incorrect DeviceID value in device.pci.add +- [e51eb2b9] vcsim: support EventFilterSpec.Time +- [1f4f5640] govc: add IPv6 support to vm.customize +- [8e45fa4a] vcsim: emit CustomizationSucceeded event from CustomizeVM +- [c000bd6e] vcsim: add DistributedVirtualSwitchManager +- [bcd5fa87] vcsim: set VirtualDisk backing UUID +- [ccdcbe89] vcsim: move product suffix in ServiceContent.About +- [393e7330] vcsim: use linked list for EventHistoryCollector +- [9c4dc1a1] vcsim: escape datastore name +- [9c2fe70f] vcsim: record/replay EnvironmentBrowser.QueryConfigOption +- [5fd7e264] vcsim: fix EventHistoryCollector fixes +- [40a2cf0b] Skip tests that require docker on TravisCI +- [00ee2911] toolbox: skip tests that require Linux +- [0b755a59] vcsim: switch bats tests from esx to vcsim env +- [c6d5264a] Updated projects to include VMware Event Broker Appliance +- [ae44a547] ExampleCollector_Retrieve: Add missing err return +- [38da87ff] examples: add NetworkReference.EthernetCardBackingInfo +- [3f1caf82] vcsim: fixes for PowerCLI Get-VirtualNetwork +- [041a98b8] Fix DvsNetworkRuleQualifier interface +- [44e05fe4] SHA-1 deprecated in 2011, sha256sum for releases + + +## [Release v0.24.0](https://github.com/vmware/govmomi/compare/v0.23.1...v0.24.0) + +> Release Date: 2020-12-21 + +### 💡 Examples + +- [7178588c] add Folder.CreateVM +- [b4f7243b] add ContainerView retrieve clusters +- [1d21fff9] use session.Cache +- [8af8cef6] add events +- [e153061f] fix simulator.RunContainer on MacOSX + +### 💫 `govc` (CLI) + +- [1ec59a7c] fix build.sh git tag injection +- [31c0836e] add cluster.usage command +- [79514c81] add volume.ls -ds option +- [5e57b3f6] add device.boot -firmware option +- [4d82f0ff] add dvs.portgroup.{add,change} '-auto-expand' flag +- [4a1d05ac] fix object.collect ContainerView updates +- [e84d0d18] document vm.disk.attach -link behavior +- [70a9ced4] fix vm.clone panic when target VM already exists +- [a97e6168] support sparse backing in vm.disk.change +- [3380cd30] add CNS volume ls and rm commands +- [f7170fd2] add find -p flag +- [b40cdd8a] add storage.policy commands +- [d0111d28] add vm.console -wss flag +- [86374ea2] support multi value flags in host.esxcli command +- [ebcfa3d4] add namespace.cluster.ls command + +### 💫 `vcsim` (Simulator) + +- [bf80efab] include stderr in log message when volume import fails +- [1f3fb17c] include stderr in log message when container fails to start +- [e1c4b06e] rewrite vmfs path from saved model +- [bcdfb298] QueryConfigOptionEx Spec is optional +- [73e1af55] support inventory updates in ContainerView +- [a76123b2] set VirtualDevice.Connectable default for removable devices +- [b195dd57] add AuthorizationManager methods +- [a71f6c77] set VirtualDisk backing option defaults +- [fbde3866] add CloneVApp_Task support +- [aae78223] fix ListView.Modify +- [9cca13ab] avoid ViewManager.ModifyListView race +- [156b1cb0] add ListView to race test +- [55f6f952] add mechanism for modeling methods +- [69942fe2] fix save/load property collection for VmwareDistributedVirtualSwitch +- [33121b87] Honoring the instance uuid provided in spec by caller ([#2052](https://github.com/vmware/govmomi/issues/2052)) + +### ⚠️ BREAKING + +### 📖 Commits + +- [1ec59a7c] govc: fix build.sh git tag injection +- [164b9217] Update docs for 0.24 release +- [bf80efab] vcsim: include stderr in log message when volume import fails +- [4080e177] Add batch APIs for multiple tags to object +- [31c0836e] govc: add cluster.usage command +- [7178588c] examples: add Folder.CreateVM +- [2b962f3f] Add test for vsan host config +- [165d7cb4] Add function to get vsan host config +- [79514c81] govc: add volume.ls -ds option +- [f7ff79df] Add Configure ACL go bindings +- [1f3fb17c] vcsim: include stderr in log message when container fails to start +- [3b83040a] Add wrappers for retrieving vsan properties +- [12e8969c] Use gofmt +- [6454dbd4] Add vSAN 7.0 API bindings +- [6a216a52] Add vSAN 7.0 API bindings +- [be15ad6c] Regenerate against vSphere 7.0U1 release +- [5e57b3f6] govc: add device.boot -firmware option +- [e1c4b06e] vcsim: rewrite vmfs path from saved model +- [26635452] Change CnsCreateVolume to return PlacementResult for static volume provisioning. Also add unit test for this case. +- [4d82f0ff] govc: add dvs.portgroup.{add,change} '-auto-expand' flag +- [bcdfb298] vcsim: QueryConfigOptionEx Spec is optional +- [8b194c23] Add Placement object in CNS CreateVolume response. Add corresponding test. +- [b085fc33] Use available ctx in enable cluster network lookup +- [f6f336ab] Cleanup some redundant code for cluster namespace enabling +- [d04f2b49] change negative one to rand neg int32 +- [f819befd] go binding for CNS RelocateVolume API +- [ed93ea7d] fix the goimports validation error +- [f402c0e1] support trunk mode port group +- [ff575977] change key default from -1 to rand neg int32 vsphere 7 introduced a key collision detection error when adding devices com.vmware.vim.vpxd.vmprov.duplicateDeviceKey which causes -1 keys to return an error of duplicate if you try and add two devices in the same AddDevice call +- [39acef43] Add option to disable secure cookies with non-TLS endpoints +- [ae19e30f] simulator: fix container vm example +- [73e1af55] vcsim: support inventory updates in ContainerView +- [593cd20d] Add namespace.cluster.disable cmd + formatting fixes +- [782ed95c] Add namespace.cluster.enable cmd to govc +- [e7403032] Make ListStorageProfiles public -> for enabling clusters in govc +- [53965796] Adds support for enabling cluster namespaces via API +- [4a1d05ac] govc: fix object.collect ContainerView updates +- [e84d0d18] govc: document vm.disk.attach -link behavior +- [a76123b2] vcsim: set VirtualDevice.Connectable default for removable devices +- [b4f7243b] examples: add ContainerView retrieve clusters +- [b195dd57] vcsim: add AuthorizationManager methods +- [a71f6c77] vcsim: set VirtualDisk backing option defaults +- [1d21fff9] examples: use session.Cache +- [8af8cef6] examples: add events +- [3e2a8071] Add ClusterDistribution field for CNS telemetry and Drop optional fields not known to the prior releases +- [4acfb726] Fix for fatal error: concurrent map iteration and map write +- [01610887] Adding VsanQueryObjectIdentities and QueryVsanObjects +- [fbde3866] vcsim: add CloneVApp_Task support +- [70a9ced4] govc: fix vm.clone panic when target VM already exists +- [a97e6168] govc: support sparse backing in vm.disk.change +- [3380cd30] govc: add CNS volume ls and rm commands +- [f9d7bfdf] sts: fix SignRequest bodyhash for non-empty request body +- [7b4e997b] vapi: add WCP support bundle bindings +- [aae78223] vcsim: fix ListView.Modify +- [0e4bce43] Add AuthorizationManager.HasUserPrivilegeOnEntities wrapper +- [81207eab] vim25/xml: sync with Go 1.15 encoding/xml +- [f7170fd2] govc: add find -p flag +- [d49123c9] Add internal.InventoryPath helper +- [b40cdd8a] govc: add storage.policy commands +- [0c5cdd5d] add / remove pci passthrough device for one VM +- [d0111d28] govc: add vm.console -wss flag +- [94bc8497] Add sms generated types and methods +- [e153061f] examples: fix simulator.RunContainer on MacOSX +- [99fe9954] finder: simplify direct use of InventoryPath func +- [3760bd6c] Added Instant Clone feature Resolves: [#1392](https://github.com/vmware/govmomi/issues/1392) +- [86374ea2] govc: support multi value flags in host.esxcli command +- [9cca13ab] vcsim: avoid ViewManager.ModifyListView race +- [156b1cb0] vcsim: add ListView to race test +- [f903d5da] Add ExtendDisk and InflateDisk wrappers to vlsm/object_manager +- [073cc310] Add AttachDisk and DetachDisk wrappers for the virtualMachine object. +- [a0c7e829] vapi: add tags.Manager.GetAttachedTagsOnObjects example +- [378a24c4] Vsan Performance Data Collection API ([#2021](https://github.com/vmware/govmomi/issues/2021)) +- [55f6f952] vcsim: add mechanism for modeling methods +- [69942fe2] vcsim: fix save/load property collection for VmwareDistributedVirtualSwitch +- [fe3becfa] bats: test fixes for running on MacOSX +- [0422a070] Merge branch 'master' into pc/HardwareInfoNotReplicatingInCloning +- [9f12aae4] vapi: add Content Library example +- [33121b87] vcsim: Honoring the instance uuid provided in spec by caller ([#2052](https://github.com/vmware/govmomi/issues/2052)) +- [9a07942b] Setting hardware properties in clone VM spec from template VM +- [ebcfa3d4] govc: add namespace.cluster.ls command +- [11d45e54] vapi: add namespace management client and vcsim support +- [cdc44d5e] vapi: add helper support "/api" endpoint + + +## [Release v0.23.1](https://github.com/vmware/govmomi/compare/v0.23.0...v0.23.1) + +> Release Date: 2020-07-02 + +### 💡 Examples + +- [0bbb6a7d] add property.Collector.Retrieve example + +### 💫 `vcsim` (Simulator) + +- [0697d33f] add HostNetworkSystem.QueryNetworkHint +- [d7f4bba6] use HostNetworkSystem wrapper with -load flag +- [916b12e6] set HostSystem IP in cluster AddHost_Task +- [e63ec002] add PbmQueryAssociatedProfile method + +### ⚠️ BREAKING + +### 📖 Commits + +- [b7add48c] check if config isn't nil before returning an uuid +- [12955a6c] added support for returning array of BaseCnsVolumeOperationResult for QueryVolumeInfo API +- [0697d33f] vcsim: add HostNetworkSystem.QueryNetworkHint +- [a5c9e1f0] Merge branch 'master' into master +- [c14e3bc5] adding in link to OPS +- [d7f4bba6] vcsim: use HostNetworkSystem wrapper with -load flag +- [916b12e6] vcsim: set HostSystem IP in cluster AddHost_Task +- [e63ec002] vcsim: add PbmQueryAssociatedProfile method +- [0bbb6a7d] examples: add property.Collector.Retrieve example + + +## [Release v0.23.0](https://github.com/vmware/govmomi/compare/v0.22.2...v0.23.0) + +> Release Date: 2020-06-11 + +### 💡 Examples + +- [0e4b487e] Fixed error is not logging in example.go +- [c17eb769] add ContainerView.Find + +### 💫 `govc` (CLI) + +- [10c22fd1] support raw object references in import.ova NetworkMapping +- [4f19eb6d] ipath search flag does not require a Datacenter +- [414c548d] support find with -customValue filter +- [0bf0e761] support VirtualApp with -pool flag +- [f1ae45f5] add -version flag to datastore.create command +- [43e4f8c2] add session.login -X flag +- [70b7e1b4] vm.clone ResourcePool is optional when -cluster is specified +- [2c5ff385] add REST support for session.login -cookie flag +- [7d66cf9a] fix host.info CPU usage +- [244a8369] add session.ls -r flag +- [6c68ccf2] add a VM template clone example +- [bb6ae4ab] ignore ManagedObjectNotFound errors in 'find' command +- [210541fe] remove ClientFlag.WithRestClient +- [75e9e80d] do not try to start a VM template +- [667e6fbe] add guest directory upload/download examples +- [167f5d83] add vm.change -uuid flag +- [bcd06cee] enable library.checkout and library.checkin by default +- [6f087ded] avoid truncation in object.collect +- [e9bb4772] add import.spec support for remote URLs +- [692c1008] support optional compute.policy.ls argument +- [814e4e5c] add vm.change '-memory-pin' flag +- [56e878a5] support nested groups in sso.group.update +- [84346733] add content library helpers +- [0ccfd912] add cluster.group.ls -l flag +- [ae84c494] use OutputFlag for import.spec +- [2dda4daa] add library.clone -ovf flag +- [519d302d] fix doc for -g flag (guest id) choices +- [e582cbd1] add object.collect -o flag +- [d2e6b7df] output formatting enhancements +- [e64c2423] add find -l flag +- [4db4430c] save sessions using sha256 ID + +### 💫 `vcsim` (Simulator) + +- [c3fe4f84] CreateSnapshotTask now returns moref in result +- [b0af443c] add lookup ServiceRegistration example +- [34734712] add AuthorizationManager.HasPrivilegeOnEntities +- [228e0a8f] traverse configManager.datastoreSystem in object.save +- [8acac02a] traverse configManager.virtualNicManager in object.save +- [8a4ab564] traverse configManager.networkSystem in object.save +- [4b8a5988] add extraConfigAlias table +- [a0fe825a] add EventHistoryCollector.ResetCollector implementation +- [558747b3] fixes for PowerCLI +- [9ae04495] apply ExtraConfig after devices +- [4286d7cd] add another test/example for DVS host member validation +- [7e24bfcb] validate DVS membership +- [853656fd] fix flaky library subscriber test +- [7426e2fd] avoid panic if ovf:capacityAllocationUnits is not present +- [55599668] support QueryConfigOptionEx GuestId param +- [67d593cc] VM templates do not have a ResourcePool +- [469e11b9] validate session key in TerminateSession method +- [88d298ff] unique MAC address for VM NICs +- [c4f820dd] create vmdk directory if needed +- [488205f0] support VMs with the same name +- [68349a27] support Folder in RelocateVM spec +- [ab1298d5] add guest operations support +- [7ffb9255] add HostStorageSystem support +- [77b31b84] avoid possible panic in UnregisterVM_Task +- [617c18e7] support tags with the same name +- [dfcf9437] add docs on generated inventory names +- [4cfc2905] add support for NSX backed networks + +### ⚠️ BREAKING + +### 📖 Commits + +- [b639ab4c] Update docs for 0.23 release +- [be7742f2] vapi: use header authentication in file Upload/Download +- [50846878] provided examples for vm.clone and host.esxcli +- [aa97c4d3] Add appliance log forwarding config handler and govc verb ([#1994](https://github.com/vmware/govmomi/issues/1994)) +- [7cdad997] Finder: support DistributedVirtualSwitch traversal +- [10c22fd1] govc: support raw object references in import.ova NetworkMapping +- [c3fe4f84] vcsim: CreateSnapshotTask now returns moref in result +- [4f19eb6d] govc: ipath search flag does not require a Datacenter +- [b0af443c] vcsim: add lookup ServiceRegistration example +- [84f1b733] simulator: fix handling of nil Reference in container walk +- [b5b434b0] Adding sunProfileName in pbm.CapabilityProfileCreateSpec +- [2111324a] providing examples for govc guest.run +- [0eef3b29] Bump to vSphere version 7 +- [b277903e] go binding for CNS QueryVolumeInfo API +- [a048ea52] Move simulator lookupservice registration into ServiceInstance +- [30f1a71a] modify markdown link at simulator.Model +- [7881f541] Add REST session keep alive support +- [3aa9aaba] vapi: sync access to rest.Client.SessionID +- [0a53ac4b] simulator: refactor folder children operations +- [b9152f85] simulator: relax ResourcePool constraint for createVM operation +- [70e9d821] simulator: relax typing condition on RP parent +- [502b7efa] simulator: relax ViewManager typing constraints +- [634fdde1] simulator: remove data race in VM creation flow +- [6eda0169] simulator: protect datastore freespace updates against data races +- [414c548d] govc: support find with -customValue filter +- [487ca0d6] Add logic to return default HealthStatus in CnsCreateVolume. +- [0bf0e761] govc: support VirtualApp with -pool flag +- [f1ae45f5] govc: add -version flag to datastore.create command +- [d0751307] Add support for attach-tag-to-multiple-objects +- [5682b1f2] simulator: relax excessive type assertions in SearchIndex +- [39a4da90] Modify parenthesis for markdown link +- [34734712] vcsim: add AuthorizationManager.HasPrivilegeOnEntities +- [92d464b9] 1. Add retry for CNS Create API with backing disk url 2. Fix binding for CnsAlreadyRegisteredFault +- [235582fe] Add sample test for Create CNS API using backing disk Url path +- [b187863a] 1. Add BackingDiskUrlPath and CnsAlreadyFault go bindings to CNS APIs 2. Update CreateVolume CNS Util to include BackingDiskUrlPath +- [409279fa] Add GetProfileNameByID functionality to PBM +- [228e0a8f] vcsim: traverse configManager.datastoreSystem in object.save +- [8acac02a] vcsim: traverse configManager.virtualNicManager in object.save +- [8a4ab564] vcsim: traverse configManager.networkSystem in object.save +- [43e4f8c2] govc: add session.login -X flag +- [70b7e1b4] govc: vm.clone ResourcePool is optional when -cluster is specified +- [2c5ff385] govc: add REST support for session.login -cookie flag +- [6ccaf303] Add guest.FileManager.TransferURL test +- [03c7611e] Avoid possible nil pointer dereference in guest TransferURL +- [44a78f96] Fix delegated Holder-of-Key token signature +- [11b2aa1a] Update to vSphere 7 APIs +- [4b8a5988] vcsim: add extraConfigAlias table +- [a0fe825a] vcsim: add EventHistoryCollector.ResetCollector implementation +- [558747b3] vcsim: fixes for PowerCLI +- [9ae04495] vcsim: apply ExtraConfig after devices +- [7d66cf9a] govc: fix host.info CPU usage +- [4286d7cd] vcsim: add another test/example for DVS host member validation +- [515621d1] Revert to using sha1 for session cache file names +- [f103a87a] Default to separate session cache directories +- [7e24bfcb] vcsim: validate DVS membership +- [244a8369] govc: add session.ls -r flag +- [6c68ccf2] govc: add a VM template clone example +- [bb6ae4ab] govc: ignore ManagedObjectNotFound errors in 'find' command +- [853656fd] vcsim: fix flaky library subscriber test +- [571f64e7] Fix existing goimport issue +- [7426e2fd] vcsim: avoid panic if ovf:capacityAllocationUnits is not present +- [9e57f983] Add non-null HostLicensableResourceInfo to HostSystem +- [210541fe] govc: remove ClientFlag.WithRestClient +- [75e9e80d] govc: do not try to start a VM template +- [d9220e5d] simulator: add interface for VirtualDiskManager +- [55599668] vcsim: support QueryConfigOptionEx GuestId param +- [67d593cc] vcsim: VM templates do not have a ResourcePool +- [667e6fbe] govc: add guest directory upload/download examples +- [167f5d83] govc: add vm.change -uuid flag +- [bcd06cee] govc: enable library.checkout and library.checkin by default +- [9d4faa6d] Refactor govc session persistence into session/cache package +- [6f087ded] govc: avoid truncation in object.collect +- [7a1fef65] Remove Task from function names in Task struct receiver methods +- [dd839655] Add SetTaskState SetTaskDescription UpdateProgress to object package +- [469e11b9] vcsim: validate session key in TerminateSession method +- [af41ae09] Revert compute policy support +- [ad612b3e] Fix the types of errors returned from VSLM tasks to be their originl vim faults rather than just wrappers of localized error msg +- [9e82230f] Remove extra err check +- [e9bb4772] govc: add import.spec support for remote URLs +- [273aaf71] skip tests when env is not set +- [159c423c] removing usage of spew package +- [76caec95] vapi: prefer header authn to cookie authn +- [6c04cfa0] Dropping fields in entity metadata for 6.7u3 +- [8d15081f] using right version and namespace from sdk/vsanServiceVersions.xml for cns client. making cns/client.go backward compatible to vsan67u3 by dropping unknown elements +- [8dfb29f5] Add nil check for taskInfo result before typecasting CnsVolumeOperationBatchResult +- [d68bbf9b] fixing CnsFault go binding +- [5482bd07] syncing vmodl changes +- [3bcace84] fixing go binding for CnsVolumeOperationResult and CnsFault +- [3c756cbd] Fixing govmomi binding for CNS as per latest VMODL for CnsVsanFileShareBackingDetails. Also fixed cns/client_test.go accordingly. +- [4254df70] Adding new API to get cluster configuration +- [0eacb4ed] removing space before omitempty tag +- [59ce7e4a] Resolve bug in Simulator regarding BackingObjectDetails +- [6ad7e87d] Change the backingObjectDetails attribute to point to interface BaseCnsBackingObjectDetails +- [601f1ded] Add resize support +- [56049aa4] Updating go binding for vsan fileshare vmodl updates +- [af798c01] Add CnsQuerySelectionNameType and CnsKubernetesEntityType back +- [af2723fd] Add bindings for vSANFS and extend CNS bindings to support file volume +- [4e7b9b00] update taskClientVersion for vsphere 7.0 +- [692c1008] govc: support optional compute.policy.ls argument +- [a7d4a77d] Modified return type for Get policy +- [4007484e] Compute Policy support +- [88d298ff] vcsim: unique MAC address for VM NICs +- [814e4e5c] govc: add vm.change '-memory-pin' flag +- [de8bcf25] reset all for recursive calls fix format error +- [57efe91f] Fixed ContainerView.RetrieveWithFilter fetch all specs if empty list of properties given +- [5af5ac8d] Avoid possible panic in Filter.MatchProperty +- [85889777] Add vAPI create binding for compute policy +- [56e878a5] govc: support nested groups in sso.group.update +- [6f46ef8a] Added prefix toggle parameter to govc export.ovf +- [6d3196e4] Disk mode should override default value in vm.disk.attach +- [4be7a425] Replaced ClassOvfParams with ClassDeploymentOptionParams +- [c4f820dd] vcsim: create vmdk directory if needed +- [1ab6fe09] Add Content Library subscriptions support +- [488205f0] vcsim: support VMs with the same name +- [68349a27] vcsim: support Folder in RelocateVM spec +- [6a6a7875] Update CONTRIBUTING to have more info about running CI tests, checks. +- [a73c0d4f] Expose Soap client default transport (a.k.a. its http client default transport) +- [84346733] govc: add content library helpers +- [a225a002] build(deps): bump nokogiri from 1.10.4 to 1.10.8 in /gen +- [b4395d65] Avoid ServiceContent requirement in lookup.NewClient +- [c1e828cb] fix blog links +- [863430ba] toolbox: bump test VM memory for current CoreOS release +- [0ccfd912] govc: add cluster.group.ls -l flag +- [1af6ec1d] Add Namespace support to UseServiceVersion +- [ab1298d5] vcsim: add guest operations support +- [0e4b487e] examples: Fixed error is not logging in example.go +- [f36e13fc] Add Content Library item copy support +- [7ffb9255] vcsim: add HostStorageSystem support +- [ae84c494] govc: use OutputFlag for import.spec +- [2dda4daa] govc: add library.clone -ovf flag +- [77b31b84] vcsim: avoid possible panic in UnregisterVM_Task +- [519d302d] govc: fix doc for -g flag (guest id) choices +- [617c18e7] vcsim: support tags with the same name +- [e582cbd1] govc: add object.collect -o flag +- [0c6eafc1] Apply gomvomi vim25/xml changes +- [4da54375] Simplify ObjectName method +- [d2e6b7df] govc: output formatting enhancements +- [dfcf9437] vcsim: add docs on generated inventory names +- [e64c2423] govc: add find -l flag +- [4db4430c] govc: save sessions using sha256 ID +- [4cfc2905] vcsim: add support for NSX backed networks +- [c17eb769] examples: add ContainerView.Find +- [36056ae6] Import golang/go/src/encoding/xml v1.13.6 +- [346cf59a] Avoid encoding/xml import +- [9cbe57db] fix simulator disk manager fault message. +- [7f685c23] Add permissions for NoCryptoAdmin + + +## [Release v0.22.2](https://github.com/vmware/govmomi/compare/v0.22.1...v0.22.2) + +> Release Date: 2020-02-13 + +### ⚠️ BREAKING + +### 📖 Commits + +- [e7df0c11] Avoid ServiceContent requirement in lookup.NewClient + + +## [Release v0.22.1](https://github.com/vmware/govmomi/compare/v0.22.0...v0.22.1) + +> Release Date: 2020-01-13 + +### ⚠️ BREAKING + +### 📖 Commits + +- [da368950] Release version 0.22.1 +- [a62b12cf] Fix AttributeValue.C14N for 6.7u3 +- [c3d102b1] Add finder example for MultipleFoundError +- [802e5899] vapi: add CreateTag example +- [15630b90] vapi: Add cluster modules client and simulator + + +## [Release v0.22.0](https://github.com/vmware/govmomi/compare/v0.21.0...v0.22.0) + +> Release Date: 2020-01-10 + +### 💡 Examples + +- [72b1cd92] output VM names in performance example +- [f4b3cda7] add Common.Rename +- [dab4ab0d] add VirtualMachine.Customize +- [1828eee9] add VirtualMachine.CreateSnapshot +- [6ff7040e] fix flag parsing +- [cad9a8e2] add ExampleVirtualMachine_Reconfigure + +### 💫 `govc` (CLI) + +- [aed39212] guest -i flag only applies to ProcessManager +- [704b335f] add 5.0 to vm.create hardware version map +- [965109ae] guest.run improvements +- [ee28fcfd] add vm.customize multiple IP support +- [68b3ea9f] fix library.info output formatting +- [5bb7f391] add optional library.info details +- [d8ac7e51] handle xsd:string responses +- [31d3e357] add library.info details +- [182c84a3] fixup tasks formatting +- [08fb2b02] remove guest.run toolbox dependency +- [a727283f] default to simple esxcli format when hints fields is empty +- [204af3c5] add datacenter create/delete examples +- [f6c57ee7] fix vm.create doc regarding -on flag +- [8debfcc3] add device.boot -secure flag +- [2bb2a6ed] add doc on vm.info -r flag +- [e50368c6] avoid env for -cluster placement flag +- [f16eb276] add default library.create thumbprint +- [d8325f34] add thumbprint flag to library.create +- [0bad2bc2] add vm.power doc +- [45d322ea] support vm.customize without a managed spec +- [0a058e0f] fixup usage suggestions +- [3185f7bc] add vm.customize command +- [1b159e27] fix datacenter.info against nested folders +- [149ba7ad] add vm.change -latency flag +- [c35a532d] validate moref argument +- [3fb02b52] add guest.df command + +### 💫 `vcsim` (Simulator) + +- [198b97ca] propagate VirtualMachineCloneSpec.Template +- [168a6a04] add -trace-file option +- [32eeeb24] Get IP address on non-default container network +- [1427d581] avoid possible panic in VirtualMachine.Destroy_Task +- [067d58be] automatically set Context.Caller +- [9e8e9a5a] remove container volumes +- [6cc814b8] bind mount BIOS UUID DMI files +- [9aec1386] validate VirtualDisk UnitNumber +- [d7e43b4e] add Floppy Drive support to OVF manager +- [8646dace] properly initialize portgroup portKeys field +- [286bd5e9] add vim25 client helper to vapi simulator +- [c3163247] use VMX_ prefix for guestinfo env vars +- [a3a09c04] don't allow duplicate names for Folder/StoragePod +- [a0a2296e] pass guestinfo vars as env vars to container vms +- [903fe182] add CustomizationSpecManager support +- [eda6bf3b] simplify container vm arguments input +- [0ce9b0a1] update docs +- [7755fbda] add record/playback functionality +- [fe000674] add VirtualMachine.Rename_Task support +- [d87cd5ac] add feature examples +- [2cc33fa8] Ensure that extraConfig from clone spec is added to VM being cloned +- [70ad060e] use exported response helpers in vapi/simulator +- [1e7aa6c2] avoid ViewManager.ViewList +- [9b0db1c2] avoid race in ViewManager +- [28b5fc6c] use TLS in simulator.Run +- [f962095f] rename Example to Run +- [43d69860] add endpoint registration mechanism +- [c183577b] add PlaceVm support ([#1589](https://github.com/vmware/govmomi/issues/1589)) +- [b17f3a51] DefaultDatastoreID is optional in library deploy + +### ⏮ Reverts + +- [7914609d] gen: retain omitempty field tag with int pointer types + +### ⚠️ BREAKING + +### 📖 Commits + +- [317707be] Update docs for 0.22 release +- [aed39212] govc: guest -i flag only applies to ProcessManager +- [22308123] Clarify DVS EthernetCardBackingInfo error message +- [a1c98f14] Add Content Library synchronization support +- [704b335f] govc: add 5.0 to vm.create hardware version map +- [4e907d99] Clarify System.Read privilege requirement for PortGroup backing +- [554d9284] Fix guest.FileManager.TransferURL cache +- [9b8da88a] Remove toolbox specific guest run implementation +- [965109ae] govc: guest.run improvements +- [ee28fcfd] govc: add vm.customize multiple IP support +- [40001828] Add OVF properties to library deploy ([#1755](https://github.com/vmware/govmomi/issues/1755)) +- [68b3ea9f] govc: fix library.info output formatting +- [198b97ca] vcsim: propagate VirtualMachineCloneSpec.Template +- [5bb7f391] govc: add optional library.info details +- [2509e907] Added the missing RetrieveSnapshotDetails API in VSLM ([#1763](https://github.com/vmware/govmomi/issues/1763)) +- [d8ac7e51] govc: handle xsd:string responses +- [45b3685d] Add library ItemType constants +- [f3e2c3ce] Add retry support for HTTP status codes +- [31d3e357] govc: add library.info details +- [182c84a3] govc: fixup tasks formatting +- [08fb2b02] govc: remove guest.run toolbox dependency +- [b10bcbf3] VSLM: fixed the missing param in the QueryChangedDiskArea API impl +- [168a6a04] vcsim: add -trace-file option +- [72b1cd92] examples: output VM names in performance example +- [32eeeb24] vcsim: Get IP address on non-default container network +- [f9f69237] Move to cs.identity service type for sso admin endpoint +- [1427d581] vcsim: avoid possible panic in VirtualMachine.Destroy_Task +- [067d58be] vcsim: automatically set Context.Caller +- [a727283f] govc: default to simple esxcli format when hints fields is empty +- [08adb5d6] Move to cs.identity service type for sts endpoint +- [9e8e9a5a] vcsim: remove container volumes +- [6cc814b8] vcsim: bind mount BIOS UUID DMI files +- [e793289c] Content Library: add CheckOuts support +- [66c9b10c] Content Library: VM Template support +- [f4b3cda7] examples: add Common.Rename +- [19a726f7] Pass vm.Config.Uuid into the "VM" container via an env var +- [204af3c5] govc: add datacenter create/delete examples +- [dab4ab0d] examples: add VirtualMachine.Customize +- [f6c57ee7] govc: fix vm.create doc regarding -on flag +- [8debfcc3] govc: add device.boot -secure flag +- [9aec1386] vcsim: validate VirtualDisk UnitNumber +- [7914609d] Revert "gen: retain omitempty field tag with int pointer types" +- [9b2c5cc6] Add CustomizationSpecManager.Info method and example +- [d7e43b4e] vcsim: add Floppy Drive support to OVF manager +- [0bf21ec2] Implement some missing methods ("*All*" variants) on SearchIndex MOB +- [2bb2a6ed] govc: add doc on vm.info -r flag +- [8646dace] vcsim: properly initialize portgroup portKeys field +- [e50368c6] govc: avoid env for -cluster placement flag +- [91b1e0a7] Add ability to set DVS discovery protocol on create and change +- [1e130141] Move to Go 1.13 +- [f16eb276] govc: add default library.create thumbprint +- [d8325f34] govc: add thumbprint flag to library.create +- [62c20113] Fix hostsystem ManagementIPs call +- [c4a3908f] Update DVS change to use finder.Network for a single object +- [ee6fe09d] Fix usage instructions +- [5e6f5e3f] gen: retain omitempty field tag with int pointer types +- [286bd5e9] vcsim: add vim25 client helper to vapi simulator +- [841386f1] Add ability to change a vnic on a host +- [391dd80b] Add ability to change the MTU on a DVS that has already been created +- [26a45d61] Change MTU param to use flags.NewInt32 as the type +- [dbcfc3a8] Add MTU flag for DVS creation +- [0399353f] Generate pointer type for ResourceReductionToToleratePercent +- [3f6b8ef5] Add nil checks for all HostConfigManager references +- [c3163247] vcsim: use VMX_ prefix for guestinfo env vars +- [5381f171] Add option to follow all struct fields in mo.References +- [04e4835c] Refactor session KeepAlive tests to use vcsim +- [7391c241] Avoid possible deadlock in KeepAliveHandler +- [41422ea4] build(deps): bump nokogiri from 1.6.3.1 to 1.10.4 in /gen +- [a3a09c04] vcsim: don't allow duplicate names for Folder/StoragePod +- [4c72d2e9] Add a method to update ports on a distributed virtual switch +- [0bad2bc2] govc: add vm.power doc +- [45d322ea] govc: support vm.customize without a managed spec +- [0a058e0f] govc: fixup usage suggestions +- [a0a2296e] vcsim: pass guestinfo vars as env vars to container vms +- [903fe182] vcsim: add CustomizationSpecManager support +- [eda6bf3b] vcsim: simplify container vm arguments input +- [0ce9b0a1] vcsim: update docs +- [c538d867] adding managed obj type to table +- [3185f7bc] govc: add vm.customize command +- [b2a7b47e] Include object.save directory in output +- [e8281f87] Initial support for hybrid Model.Load +- [7755fbda] vcsim: add record/playback functionality +- [8a3fa4f2] set stable vsan client version +- [9eaac5cb] Avoid empty principal in HoK token request +- [4a8da68d] Allow sending multiple characters through -c and name the keys +- [3e3d3515] add simple command list filter +- [fe000674] vcsim: add VirtualMachine.Rename_Task support +- [9166bbdb] support two tags with the same name +- [344653c1] added log type and password scrubber +- [d87cd5ac] vcsim: add feature examples +- [30fc2225] Report errors when cdrom.insert fails +- [a94f2d3a] vslm: fix to throw errors on tasks that are completed with error state +- [37054f03] added IsTemplate vm helper +- [d7aeb628] Fix object.collect with moref argument +- [0765aa63] add GetInventoryPath to NetworkReference interface +- [9fb975b0] Fix description of vm.keystrokes +- [234aaf53] vapi: support DeleteLibrary with subscribed libraries +- [2cc33fa8] vcsim: Ensure that extraConfig from clone spec is added to VM being cloned +- [70ad060e] vcsim: use exported response helpers in vapi/simulator +- [b069efc0] vapi: refactor for external API implementations +- [1e7aa6c2] vcsim: avoid ViewManager.ViewList +- [9b0db1c2] vcsim: avoid race in ViewManager +- [bd298f43] a failing testcase that triggers with -race test +- [03422dd2] vapi: expand internal path constants +- [d296a5f8] Support HoK tokens with Interactive Users +- [c6226542] Fix error check in session.Secret +- [28b5fc6c] vcsim: use TLS in simulator.Run +- [f9b4bb05] Replace LoadRetrievePropertiesResponse with LoadObjectContent +- [d84679eb] Add VirtualHardwareSection.StorageItem +- [a23a5cb1] Check whether there's a NIC before updating guest.ipAddress +- [8a069c27] Add interactiveSession flag +- [25526b21] vm.keystrokes -s (Allow spaces) +- [1828eee9] examples: add VirtualMachine.CreateSnapshot +- [ca3763e7] vapi: return info with current session query +- [f962095f] vcsim: rename Example to Run +- [43d69860] vcsim: add endpoint registration mechanism +- [1b159e27] govc: fix datacenter.info against nested folders +- [c183577b] vcsim: add PlaceVm support ([#1589](https://github.com/vmware/govmomi/issues/1589)) +- [3e71d6be] Add ResourcePool.Owner method +- [b17f3a51] vcsim: DefaultDatastoreID is optional in library deploy +- [68980704] Update generated code to vSphere 6.7u3 +- [7416741c] Add VirtualMachine.QueryChangedDiskAreas(). +- [8ef87890] Content library: support library ID in Finder +- [e373feb8] Add option to propagate MissingSet faults in property.WaitForUpdates +- [6ff7040e] examples: fix flag parsing +- [149ba7ad] govc: add vm.change -latency flag +- [c35a532d] govc: validate moref argument +- [54df157b] Add content library subscription support +- [b86466b7] Fix deadlock for keep alive handlers that attempt log in +- [9ad64557] CNS go bindings +- [9de3b854] Add simulator.Model.Run example +- [4285b614] Include url in Client.Download error +- [caf0b6b3] vcsa: update to 6.7 U3 +- [7ac56b64] Update vcsim Readme.md +- [48ef35df] Update README.md +- [a40837d8] Use gnu xargs in bats tests on Darwin +- [51ad97e1] Add FetchCapabilityMetadata method to Pbm client +- [d124bece] Add v4 option to VirtualMachine.WaitForIP +- [a5a429c0] Add support for the cis session get method +- [4513735f] Don't limit library.Finder to local libraries +- [cad9a8e2] examples: add ExampleVirtualMachine_Reconfigure +- [3fb02b52] govc: add guest.df command + + +## [Release v0.21.0](https://github.com/vmware/govmomi/compare/v0.20.3...v0.21.0) + +> Release Date: 2019-07-24 + +### 💡 Examples + +- [9495f0d8] add CustomFieldManager.Set + +### 💫 `govc` (CLI) + +- [fa755779] support library paths in tags.attach commands +- [2ddfb86b] add datastore.info -H flag +- [b3adfff2] add sso.group commands +- [b5372b0c] host.vnic.info -json support +- [4c41c167] add context to LoadX509KeyPair error +- [910dac72] add vm.change hot-add options +- [746c314e] change logs.download -default=false +- [05f946d4] increase guest.ps -X poll interval +- [cc10a075] add -options support to library.deploy +- [fe372923] rename vcenter.deploy to library.deploy +- [436d7a04] move library.item.update commands to library.session +- [e6514757] consolidate library commands +- [f8249ded] export Archive Path field +- [d2ab2782] add vm.change vpmc-enabled flag +- [e7b801c6] fix vm.change against templates +- [8a856429] fix option.set for int32 type values +- [81391309] add datastore.maintenance.{enter,exit} commands +- [18cb9142] FCD workarounds +- [665affe5] add datastore.cluster.info Description +- [7b7f2013] add permission.remove -f flag + +### 💫 `vcsim` (Simulator) + +- [774f3800] add support to override credentials +- [ecd7312b] fix host uuid +- [c25c41c1] use stable UUIDs for inventory objects +- [1345eeb8] Press any key to exit +- [ee14bd3d] Update NetworkInfo.Portgroup in simulator +- [5b5eaa70] remove httptest.serve flag +- [20c1873e] add library.deploy support +- [0b1ad552] add ovf manager +- [6684016f] fork httptest server package +- [48c1e0a5] add content library support +- [8543ea4f] set guest.toolsRunningStatus property + +### ⚠️ BREAKING + +### 📖 Commits + +- [a0fef816] Update docs for 0.21 release +- [a38f6e87] Content library related cleanups +- [e4024e9c] Fix library AddLibraryItemFileFromURI fingerprint +- [fa755779] govc: support library paths in tags.attach commands +- [5e8cb495] Fixed type bug in global_object_manager Task.QueryResult +- [4a67dc73] govcsim: Support Default UplinkTeamingPolicy in DVSPG +- [9da2362d] Added missing field in VslmExtendDisk_Task in ExtendDisk method +- [91377d77] Add Juju to projects using govmomi +- [f9026a84] VSLM FCD Global Object Manager client for 6.7U2+ +- [9495f0d8] examples: add CustomFieldManager.Set +- [bb170705] govcsim: Create datastore as accessible +- [35d0b7d3] Set the InventoryPath of the folder object in DefaultFolder ([#1515](https://github.com/vmware/govmomi/issues/1515)) +- [2d13a357] Add govmomi performance example +- [2ddfb86b] govc: add datastore.info -H flag +- [55da29e5] govcsim: Set datastore status as normal +- [600e9f7c] Add various govmomi client examples +- [5cccd732] Add http source support to library.import +- [99dd5947] Goreleaser update for multiple archives +- [b3adfff2] govc: add sso.group commands +- [5889d091] tags API: add methods for association of multiple tags/objects +- [b5372b0c] govc: host.vnic.info -json support +- [9b7688e0] Add method that sets vim version to the endpoint service version +- [fe3488f5] Fix tls config in soap.NewServiceClient +- [4c41c167] govc: add context to LoadX509KeyPair error +- [d7430825] Support external PSC lookup service +- [774f3800] vcsim: add support to override credentials +- [47c9c070] Fix HostNetworkSystem.QueryNetworkHint return value +- [910dac72] govc: add vm.change hot-add options +- [4606125e] Fix json request tracing +- [746c314e] govc: change logs.download -default=false +- [05f946d4] govc: increase guest.ps -X poll interval +- [77cb9df5] Add library export support +- [cc10a075] govc: add -options support to library.deploy +- [ecd7312b] vcsim: fix host uuid +- [c25c41c1] vcsim: use stable UUIDs for inventory objects +- [322d9629] Fix pbm field type lookup +- [1345eeb8] vcsim: Press any key to exit +- [a4f58ac6] Update examples to use examples.Run method +- [a31db862] Add permanager example +- [384b1b95] Fix port signature in REST endpoint token auth +- [c222666f] Default to running against vcsim in examples +- [199e737b] Add generated vslm types and methods +- [ee14bd3d] vcsim: Update NetworkInfo.Portgroup in simulator +- [dc631a2d] Format import statement +- [f133c9e9] Fix paths in vsan/methods +- [d8e7cc75] Update copy rights +- [62412641] Add vsan bindings +- [fc3f0e9d] Support resignature of vmfs snapshots ([#1442](https://github.com/vmware/govmomi/issues/1442)) +- [fe372923] govc: rename vcenter.deploy to library.deploy +- [436d7a04] govc: move library.item.update commands to library.session +- [e6514757] govc: consolidate library commands +- [f8249ded] govc: export Archive Path field +- [8a823c52] vcsa: bump to 6.7u2 +- [5b5eaa70] vcsim: remove httptest.serve flag +- [466dc5b2] Update to vSphere 6.7u2 API +- [e9f80882] Add error check to VirtualMachine.WaitForNetIP +- [5611aaa2] Add ovftool support +- [20c1873e] vcsim: add library.deploy support +- [0b1ad552] vcsim: add ovf manager +- [d2ab2782] govc: add vm.change vpmc-enabled flag +- [e7b801c6] govc: fix vm.change against templates +- [8a856429] govc: fix option.set for int32 type values +- [9155093e] Typo and->an +- [81391309] govc: add datastore.maintenance.{enter,exit} commands +- [1a857b94] Add support to reconcile FCD datastore inventory +- [18cb9142] govc: FCD workarounds +- [499a8828] Fix staticcheck issues value of `XXX` is never used +- [665affe5] govc: add datastore.cluster.info Description +- [546e8897] Add error check for deferred functions +- [367c8743] Fix bug with multiple tags in category +- [7b7f2013] govc: add permission.remove -f flag +- [87bc0c85] Makefile: Fix govet target using go1.12 +- [791e5434] travis.yml: Update from golang 1.11 to 1.12 +- [a86a42a2] travis.yml: Update from Ubuntu Trusty to Xenial +- [d92ee75e] Report local Datastore back as type OTHER +- [6684016f] vcsim: fork httptest server package +- [48c1e0a5] vcsim: add content library support +- [69faa2de] Make PostEvent TaskInfo param optional +- [608ad29f] Omit namespace tag in generated method body response types +- [a7c03228] Fix codespell issues +- [728e77db] Fix a race in NewServer(). +- [8543ea4f] vcsim: set guest.toolsRunningStatus property +- [e3143407] Fix elseif gocritic issues +- [89b53312] Fix gocritic emptyStringTest issues +- [63ba9232] Fix some trivial gocritic issues +- [0b8d0ee7] simulator/host_datastore_browser.go: remove commented out code +- [6c17d66c] Fix some staticcheck issues +- [d45b5f34] Fix some gosimple issues +- [90e501a6] Correct the year in the govc changelog +- [8082a261] Update XDR to use fork +- [e94ec246] govc/USAGE.md: Update documentation +- [3fde3319] snapshot.tree: Show snapshots description +- [1d6f743b] Fix year in changelog +- [39b2c871] support customize vm folder in ovf deploy +- [3ad203d3] Use rest.Client for library uploads +- [5d24c38c] lib/finder: Support filenames with "/" +- [087f09f9] govc library: use govc/flags for Datastore and ResourcePool +- [d1a7f491] Remove nested progress.Tee usage +- [7312711e] govc/vm/*: Fix some gosec Errors unhandled issues +- [88601bb7] vcsim/*: Fix Errors unhandled issues +- [61d04b46] session/*: Fix Errors unhandled issues +- [f9a22349] vmdk/*: Fix gosec Errors unhandled issues +- [ca9b71a9] Fix gosec Expect directory permissions to be 0750 or less issues +- [6083e891] Fix gosec potential file inclusion via variable issues +- [38091bf8] Build changes needed for content library +- [885d4b44] Content library additions/finder +- [3fb72d1a] Add support for content library +- [64f2a5ea] Fix API Version check. +- [718331e3] govc/*: Fix some staticcheck issues +- [ba7923ae] Fix all staticcheck "error strings should not be capitalized" issues +- [ed32a917] simulator/*: Fix some staticcheck issues +- [f71d4efb] govc/vm/*: Fix staticcheck issues +- [3d77e2b1] vim25/*: Fix staticcheck issues +- [d711005a] .gitignore: add editor files *~ +- [43ff04f1] Fix [#1173](https://github.com/vmware/govmomi/issues/1173) +- [562aa0db] Go Mod Support + + +## [Release v0.20.3](https://github.com/vmware/govmomi/compare/v0.20.2...v0.20.3) + +> Release Date: 2019-10-08 + +### ⚠️ BREAKING + +### 📖 Commits + +- [fdd27786] Fix tls config in soap.NewServiceClient + + +## [Release v0.20.2](https://github.com/vmware/govmomi/compare/v0.20.1...v0.20.2) + +> Release Date: 2019-07-03 + +### ⚠️ BREAKING + +### 📖 Commits + +- [bd9cfd18] Set the InventoryPath of the folder object in DefaultFolder ([#1515](https://github.com/vmware/govmomi/issues/1515)) + + +## [Release v0.20.1](https://github.com/vmware/govmomi/compare/v0.20.0...v0.20.1) + +> Release Date: 2019-05-20 + +### ⚠️ BREAKING + +### 📖 Commits + +- [4514987f] Fix port signature in REST endpoint token auth + + +## [Release v0.20.0](https://github.com/vmware/govmomi/compare/v0.19.0...v0.20.0) + +> Release Date: 2019-02-06 + +### 💫 `govc` (CLI) + +- [308dbf99] fix object.collect error for multiple objects with same path +- [4635c1cc] add device name match support to device.ls and device.remove +- [c36eb50f] add vm.disk.attach -mode flag +- [b234cdbc] add category option to relevant tags commands +- [afe5f42d] add vm.create -version option +- [b733db99] fields.set can now add missing fields +- [cad627a6] add fields.info command + +### 💫 `vcsim` (Simulator) + +- [957ef0f7] require authentication in vapi simulator +- [32148187] Resolve issue making device changes on clone (resolves [#1355](https://github.com/vmware/govmomi/issues/1355)) +- [cbb4abc9] fix SearchDatastore task info entity +- [2682c021] add EnvironmentBrowser support +- [3b9a4c9f] avoid zero IP address in GOVC_URL output +- [1921f73a] avoid panic when event template is not defined +- [d79013aa] implement RefreshStorageInfo method for virtual machine +- [69dfdd77] configure HostSystem port +- [bba50b40] datastore.upload now creates missing directories in destination path. +- [d2506759] add option to run container as vm +- [47284860] add SessionIsActive support +- [c5ee00bf] fix fault detail encoding +- [1284300c] support base types in property filter +- [25ae5c67] PropertyCollector should not require PathSet +- [4f1c89e5] allow '.' in vm name +- [b8c04142] populate VM guest.net field +- [223b2a2a] add SearchIndex FindByDnsName support +- [b26e10f0] correct property update in RemoveSnapshotTask +- [693f3fb6] update VM snapshot methods to change VM properties with UpdateObject +- [06e13bbe] support setting vm fields via extraConfig +- [a4330365] update VM configureDevices method to change VM properties with UpdateObject +- [5f8acb7a] update VM device add operation - stricter key generation, new InvalidDeviceSpec condition +- [846ae27a] add PBM support +- [d41d18aa] put VM into registry earlier during CreateVM +- [89b4c2ce] add datastore access check for vm host placement +- [f9f9938e] add task_manager description property templates +- [9bb5bde2] fix defaults when generating vmdk paths +- [0b650fd3] fix custom_fields_manager test +- [588bc224] replace HostSystem template IP with vcsim listen address +- [7066f8dc] Change CustomFieldsManager SetField to use ctx.WithLock and add InvalidArgument fault check. +- [fe070811] update DVS methods to use UpdateObject instead of setting fields directly +- [03939cce] add vslm support +- [c02efc3d] add setCustomValue support +- [94804159] add fault message to PropertyCollector RetrieveProperties +- [36035f5b] add HistoryCollector scrollable view support + +### ⚠️ BREAKING + +### 📖 Commits + +- [da7af247] Fix for govc/build.sh wrong dir +- [90a863be] Update docs for 0.20 release +- [957ef0f7] vcsim: require authentication in vapi simulator +- [32148187] vcsim: Resolve issue making device changes on clone (resolves [#1355](https://github.com/vmware/govmomi/issues/1355)) +- [a7563c4d] Use path id for tag-association requests +- [cbb4abc9] vcsim: fix SearchDatastore task info entity +- [2682c021] vcsim: add EnvironmentBrowser support +- [3b9a4c9f] vcsim: avoid zero IP address in GOVC_URL output +- [b261f25d] Add 2x blog posts about vcsim +- [1921f73a] vcsim: avoid panic when event template is not defined +- [308dbf99] govc: fix object.collect error for multiple objects with same path +- [d79013aa] vcsim: implement RefreshStorageInfo method for virtual machine +- [69dfdd77] vcsim: configure HostSystem port +- [4f50681f] Fix of the missing http body close under soap client upload +- [bba50b40] vcsim: datastore.upload now creates missing directories in destination path. +- [8ac7c5a8] Fixed 64-bit aligment issues with atomic counters +- [7ca12ea2] fix device.info Write output +- [3a82237c] device.ls -json doesn't work for now +- [86f4ba29] ssoadmin:create local group and add users to group ([#1327](https://github.com/vmware/govmomi/issues/1327)) +- [2d8ef2c6] Format with latest version of goimports +- [4635c1cc] govc: add device name match support to device.ls and device.remove +- [d7857a13] Updated the examples for the correct format +- [71e19136] Updated to reflect PR feedback +- [d2506759] vcsim: add option to run container as vm +- [61b7fe3e] Added string support +- [a72a4c42] Initial Support for PutUsbScanCodes +- [47284860] vcsim: add SessionIsActive support +- [c5ee00bf] vcsim: fix fault detail encoding +- [aaf83275] Summary of changes: 1. Changing the pbm client's path as java client is expecting /pbm. 2. Added PbmRetrieveServiceContent method in the unauthorized list. +- [c36eb50f] govc: add vm.disk.attach -mode flag +- [1284300c] vcsim: support base types in property filter +- [25ae5c67] vcsim: PropertyCollector should not require PathSet +- [b234cdbc] govc: add category option to relevant tags commands +- [138f30f8] Makefiles for govc/vcsim; updates govc/build.sh +- [4f1c89e5] vcsim: allow '.' in vm name +- [afe5f42d] govc: add vm.create -version option +- [b8c04142] vcsim: populate VM guest.net field +- [223b2a2a] vcsim: add SearchIndex FindByDnsName support +- [b26e10f0] vcsim: correct property update in RemoveSnapshotTask +- [693f3fb6] vcsim: update VM snapshot methods to change VM properties with UpdateObject +- [e5948f44] build: Refactored Travis-CI to use containers +- [06e13bbe] vcsim: support setting vm fields via extraConfig +- [651d4881] Allow pointer values in mo.ApplyPropertyChange +- [546a7df6] Tags support for First Class Disks +- [a4330365] vcsim: update VM configureDevices method to change VM properties with UpdateObject +- [5f8acb7a] vcsim: update VM device add operation - stricter key generation, new InvalidDeviceSpec condition +- [86375ceb] Merge branch 'master' into fields-info +- [bf962f18] Update govc/fields/add.go +- [98575e0c] Update govc/fields/add.go +- [b733db99] govc: fields.set can now add missing fields +- [cad627a6] govc: add fields.info command +- [ed2a4cff] vm.power: Make waiting for op completion optional +- [846ae27a] vcsim: add PBM support +- [d41d18aa] vcsim: put VM into registry earlier during CreateVM +- [1926071e] Datastore Cluster placement support for First Class Disks +- [89b4c2ce] vcsim: add datastore access check for vm host placement +- [f9f9938e] vcsim: add task_manager description property templates +- [9bb5bde2] vcsim: fix defaults when generating vmdk paths +- [0b650fd3] vcsim: fix custom_fields_manager test +- [588bc224] vcsim: replace HostSystem template IP with vcsim listen address +- [7066f8dc] vcsim: Change CustomFieldsManager SetField to use ctx.WithLock and add InvalidArgument fault check. +- [ef517cae] Display category name instead of ID in govc tags.info +- [d69c9787] goimports updates +- [fe070811] vcsim: update DVS methods to use UpdateObject instead of setting fields directly +- [03939cce] vcsim: add vslm support +- [accb2863] Add vslm package and govc disk commands +- [478ebae6] [doc] add an example for cpu and memory hotplug +- [c02efc3d] vcsim: add setCustomValue support +- [c3c79d16] goimports updates +- [ce71b6c2] vcsa: bump to 6.7.0 U1 +- [94804159] vcsim: add fault message to PropertyCollector RetrieveProperties +- [1ad0d87d] Removed NewWithDelay (not needed anymore) +- [5900feef] Updated documentation +- [5a87902b] Added delay functionality +- [c0518fd2] Add LoginByToken to session KeepAliveHandler +- [e0736431] Update Ansible link in README +- [36035f5b] vcsim: add HistoryCollector scrollable view support +- [bc2636fe] Move govc tags rest.Client helper to ClientFlag +- [54a181af] Add SSO support for vAPI +- [8817c27b] replace * by client's host+port +- [ac898b50] change hostname only if set to * and still set thumbprint +- [7a5cc6b7] replace hostname only if unset + + +## [Release v0.19.0](https://github.com/vmware/govmomi/compare/v0.18.0...v0.19.0) + +> Release Date: 2018-09-30 + +### 💫 `govc` (CLI) + +- [6b4a62b1] fix test case for new cluster.rule.info command +- [1350eea6] add new command cluster.rule.info + +### 💫 `vcsim` (Simulator) + +- [f3260968] add dvpg networks to HostSystem.Parent +- [17352fce] add support for tags API +- [c29d4b12] Logout should not unregister PropertyCollector singleton +- [11fb0d58] add ResetVM and SuspendVM support +- [39e6592d] add support for PropertyCollector incremental updates +- [619fbe28] do not include DVS in HostSystem.Network + +### ⚠️ BREAKING + +### 📖 Commits + +- [3617f28d] Update docs for 0.19 release +- [4316838a] vcsa: bump to 6.7.0d +- [64d875b9] Added PerformanceManager simulator +- [f3260968] vcsim: add dvpg networks to HostSystem.Parent +- [862da065] Allowing the use of STS for exchanging tokens +- [83ce863a] Handle empty file name in import.spec +- [a99f702d] Bump travis golang version from 1.10 to 1.11 +- [e4e8e2d6] Clean up unit test messaging +- [8e04e3c7] Run goimports on go source files +- [2431ae00] Add mailmap for bruceadowns +- [e805b4ea] Updates per dep ensure integration +- [70589fb6] Add ignore of intellij project settings directory +- [d114fa69] Print action for dvs security groups +- [d458266a] fix double err check +- [3f0e0aa7] remove providerSummary cache +- [cf9c16c4] Avoid use of Finder all param in govc +- [c4face4f] Print DVS rules for dvportgroup +- [91a33dd4] Finalize tags API +- [7d54bf9f] README: Fix path to LICENSE.txt file +- [17352fce] vcsim: add support for tags API +- [c29d4b12] vcsim: Logout should not unregister PropertyCollector singleton +- [8bda0ee1] Fix format in test +- [8be5207c] Add test for WaitOption.MaxWaitSeconds == 0 behaviour in simulator +- [900e1a35] Fix the WaitOption.MaxWaitSeconds == 0 behaviour in simulator +- [056ad0d4] vcsa: bump to 6.7.0c release +- [6b4a62b1] govc: fix test case for new cluster.rule.info command +- [1350eea6] govc: add new command cluster.rule.info +- [a05cd4b0] add output in cluster.rule.ls -name for ClusterVmHostRuleInfo and ClusterDependencyRuleInfo rules, add -l Option to cluster.rule.ls +- [11fb0d58] vcsim: add ResetVM and SuspendVM support +- [3e6b2d6e] Add ability to move multiple hosts into a cluster +- [e9f9920f] Add method to move host into cluster +- [39e6592d] vcsim: add support for PropertyCollector incremental updates +- [b7c270c6] Add testing support for govc tags commands +- [619fbe28] vcsim: do not include DVS in HostSystem.Network +- [6b6060dc] show rule details for ClusterVmHostRuleInfo rules in cluster.rule.ls +- [0c28a25d] Use govc find instead of ls to assign licenses +- [c1377063] Only test with Go 1.10 on Travis CI +- [4cfadda5] Avoid panic if fault detail is nil +- [d06874e1] Upgrade for govc tags commands +- [fdfaec9c] Better documentation for VirtualMachine.UUID +- [e1285a03] Add UUID helper for VirtualMachine +- [919b728c] Complete tags management APIs ([#1162](https://github.com/vmware/govmomi/issues/1162)) +- [b3251638] vcsa: bump to 6.7.0a release +- [a1fbb6ef] Optionally check root CAs for validity ([#1154](https://github.com/vmware/govmomi/issues/1154)) +- [add38bed] Fixed govc host.info logical CPU count +- [1ddfb011] Tags Categories cmd available ([#1150](https://github.com/vmware/govmomi/issues/1150)) +- [83ae35fb] default MarkAsTemplate to false in import spec +- [49f0dea7] add option to mark VM as template on OVX import +- [1f9e19f4] example: uniform unit for host memory +- [4cfd1376] fix example output. + + +## [Release v0.18.0](https://github.com/vmware/govmomi/compare/v0.17.1...v0.18.0) + +> Release Date: 2018-05-24 + +### 💫 `govc` (CLI) + +- [b841ae01] import.ovf pool flag should be optional if host is specified +- [f5c84b98] avoid Login() attempt if username is not set +- [d91fcbf4] add json support to find command +- [ba2d2323] fix host.esxcli error handling + +### 💫 `vcsim` (Simulator) + +- [8a5438b0] add STS simulator +- [c0337740] use VirtualDisk CapacityInKB for device summary +- [3d7fbac2] add property collector field type mapping for integer arrays + +### ⚠️ BREAKING + +### 📖 Commits + +- [e4b69fab] Update docs for 0.18 release +- [1dbfb317] Bump versions +- [b841ae01] govc: import.ovf pool flag should be optional if host is specified +- [96a905c1] Add -sharing option to vm.disk.create and vm.disk.attach +- [4b4e2aaa] Add VirtualDiskManager wrapper to set UUID +- [40a565b3] adjust datastore size when vm is added or updated or deleted +- [7f6479ba] update datastore capacity and free space when it is started +- [76dfefd3] Avoid recursive root path search in govc find command +- [623c7fa9] Change key name according to Datacenter object +- [24d0cf1b] added check for `InstanceUuid` when `VmSearch` is true in `FindByUuid` +- [25fc474c] Issue token if needed for govc sso commands +- [822fd1c0] Fixed leading "/" requirement in FindByInventoryPath +- [59d9f6a0] Add devbox scripts +- [fd45d81c] Add -U option to sso.service.ls +- [f5c84b98] govc: avoid Login() attempt if username is not set +- [8a5438b0] vcsim: add STS simulator +- [93f7fbbd] Fix govc vm.clone -annotation flag +- [bcff5383] save CapacityInKB in thousand delimited format +- [db12d4cb] Avoid possible panic in portgroup EthernetCardBackingInfo +- [d120efcb] Add STS support for token renewal +- [76b1ceaf] Add vmxnet2, pcnet32 and sriov to VirtualDeviceList.EthernetCardTypes +- [c0337740] vcsim: use VirtualDisk CapacityInKB for device summary +- [3d7fbac2] vcsim: add property collector field type mapping for integer arrays +- [42b30bb6] Finder.DefaultHostSystem should find hosts in nested folders +- [b8323d6b] Avoid property.Filter matching against unset properties +- [64788667] Update to vSphere 6.7 API +- [d3ae3004] Bump vCenter and ESXi builds to the latest release +- [098fc449] Add ssoadmin client and commands +- [80a9c20e] vm.Snapshot should be 'nil' instead of an empty 'vim.vm.SnapshotInfo' when there are no snapshots +- [1b1b428e] added failing tests for when vm.Snapshot should / shouldn't be 'nil' +- [a34ab4ba] Refactor LoginExtensionByCertificate tunnel usage +- [5b36033f] Lookup Service support +- [3f07eb74] add empty fields, but don't return them in the case of 'RetrievePropertiesEx' +- [05bdabe0] added failing test case for issue 1061 +- [903e8644] SAML token authentication support +- [d91fcbf4] govc: add json support to find command +- [ba2d2323] govc: fix host.esxcli error handling +- [ff687746] Dep Support +- [5f701460] Add -firmware parameter to 'govc vm.create' with values bios|efi + + +## [Release v0.17.1](https://github.com/vmware/govmomi/compare/v0.17.0...v0.17.1) + +> Release Date: 2018-03-19 + +### 💫 `vcsim` (Simulator) + +- [0502ee9b] add Destroy method for Folder and Datacenter types +- [0636dc8c] add EventManager.QueryEvents + +### ⚠️ BREAKING + +### 📖 Commits + +- [123ed177] govc release 0.17.1 +- [24d88451] Avoid possible panic in QueryVirtualDiskInfo +- [82129fb7] Add goreleaser to automate release process +- [ce88b296] Fix dvs.portgroup.info filtering +- [0502ee9b] vcsim: add Destroy method for Folder and Datacenter types +- [1620160d] In progress.Reader emit final report on EOF. +- [0636dc8c] vcsim: add EventManager.QueryEvents + + +## [Release v0.17.0](https://github.com/vmware/govmomi/compare/v0.16.0...v0.17.0) + +> Release Date: 2018-02-28 + +### 💫 `govc` (CLI) + +- [29498644] fix vm.clone to use -net flag when source does not have a NIC +- [d12b8f25] object.collect support for raw filters +- [6cb9fef8] fix host.info CPU usage +- [5786e7d2] add -cluster flag to license.assign command +- [d4ee331c] allow columns in guest login password ([#972](https://github.com/vmware/govmomi/issues/972)) + +### 💫 `vcsim` (Simulator) + +- [d2ba47d6] add simulator.Datastore type +- [937998a1] set VirtualMachine summary.config.instanceUuid +- [1c76c63d] update HostSystem.Summary.Host reference +- [274f3d63] add EventManager support +- [cc21a5ab] stats related fixes +- [fa2bee10] avoid data races +- [ca6f5d1d] respect VirtualDeviceConfigSpec FileOperation +- [7811dfce] avoid keeping the VM log file open +- [828ce5ec] add UpdateOptions support +- [d03f38fa] add session support +- [a3c9ed2b] Add VM.MarkAsTemplate support +- [50735461] more input spec honored in ReConfig VM +- [638d972b] Initialize VM fields properly +- [aa0382c1] Honor the input spec in ReConfig VM +- [42f9a133] Add HostLocalAccountManager +- [76f376a3] workaround xml ns issue with pyvsphere ([#958](https://github.com/vmware/govmomi/issues/958)) +- [45c5269b] add MakeDirectoryResponse ([#938](https://github.com/vmware/govmomi/issues/938)) +- [b4e77bd2] copy RoleList for AuthorizationManager ([#932](https://github.com/vmware/govmomi/issues/932)) +- [2a8a5168] apply vm spec NumCoresPerSocket ([#930](https://github.com/vmware/govmomi/issues/930)) +- [3a61d85f] Configure dvs with the dvs config spec +- [5f0f4004] Add VirtualMachine guest ID validation ([#921](https://github.com/vmware/govmomi/issues/921)) +- [ef571547] add QueryVirtualDiskUuid ([#920](https://github.com/vmware/govmomi/issues/920)) +- [27229ab7] update ServiceContent to 6.5 ([#917](https://github.com/vmware/govmomi/issues/917)) + +### ⚠️ BREAKING + +### 📖 Commits + +- [1d63da8d] govc release 0.17 +- [3017acf8] Print Table of Contents in usage.md Found good example of toc using markdown here: https://stackoverflow.com/a/448929/1572363 +- [ce54fe2c] Fix typo +- [201fc601] Implement Destroy task for HostSystem +- [92ce4244] Init PortKeys in DistributedVirtualPortgroup +- [795f2cc7] Avoid json encoding error in Go 1.10 +- [e805389e] Add 'Type' field to device.info -json output +- [d622f149] Use VirtualDiskManager in datastore cp and mv commands +- [f219bf3b] object: Return correct helper object for OpaqueNetwork +- [29498644] govc: fix vm.clone to use -net flag when source does not have a NIC +- [43c95b21] Fix build on Windows +- [38124002] Fix session persistence in session.login command +- [144bb1cf] Add support for Datacenter.PowerOnMultiVM +- [d2ba47d6] vcsim: add simulator.Datastore type +- [937998a1] vcsim: set VirtualMachine summary.config.instanceUuid +- [1c76c63d] vcsim: update HostSystem.Summary.Host reference +- [d12b8f25] govc: object.collect support for raw filters +- [274f3d63] vcsim: add EventManager support +- [cc21a5ab] vcsim: stats related fixes +- [2d30cde3] Fix broken datastore link in VM +- [54b160b2] Several context changes: +- [f643f0ae] Leverage contexts in http uploads +- [fa2bee10] vcsim: avoid data races +- [29bd00ec] Remove omitempty tag from AffinitySet field +- [ca6f5d1d] vcsim: respect VirtualDeviceConfigSpec FileOperation +- [7811dfce] vcsim: avoid keeping the VM log file open +- [6cb9fef8] govc: fix host.info CPU usage +- [5786e7d2] govc: add -cluster flag to license.assign command +- [63c86f29] Add datastore.disk.cp command +- [828ce5ec] vcsim: add UpdateOptions support +- [a13ad164] Bump vcsa scripts to use 6.5U1 EP5 +- [c447244d] Add CloneSession support to govc and vcsim +- [d03f38fa] vcsim: add session support +- [44e8d85e] Added AttachScsiLun function ([#987](https://github.com/vmware/govmomi/issues/987)) +- [a3c9ed2b] vcsim: Add VM.MarkAsTemplate support +- [3f8349f3] Add cluster vm override commands ([#977](https://github.com/vmware/govmomi/issues/977)) +- [91fbd1f7] Add option to filter events by type ([#976](https://github.com/vmware/govmomi/issues/976)) +- [1d8b92d9] User server clock in session.ls ([#973](https://github.com/vmware/govmomi/issues/973)) +- [50735461] vcsim: more input spec honored in ReConfig VM +- [638d972b] vcsim: Initialize VM fields properly +- [2892ed50] Add '-rescan-vmfs' option to host.storage.info ([#966](https://github.com/vmware/govmomi/issues/966)) +- [d4ee331c] govc: allow columns in guest login password ([#972](https://github.com/vmware/govmomi/issues/972)) +- [e15ff586] Use IsFileNotFound helper in Datastore.Stat ([#969](https://github.com/vmware/govmomi/issues/969)) +- [aa0382c1] vcsim: Honor the input spec in ReConfig VM +- [465bd948] Hook AccountManager to UserDirectory +- [aef2d795] Destroy event history collectors ([#962](https://github.com/vmware/govmomi/issues/962)) +- [42f9a133] vcsim: Add HostLocalAccountManager +- [76f376a3] vcsim: workaround xml ns issue with pyvsphere ([#958](https://github.com/vmware/govmomi/issues/958)) +- [a1c49292] Ignore AcquireLocalTicket errors ([#955](https://github.com/vmware/govmomi/issues/955)) +- [bb150d50] Add missing dependency in gen script +- [0eacf959] toolbox: validate request offset in ListFiles ([#946](https://github.com/vmware/govmomi/issues/946)) +- [1d6aed22] Corrects datastore.disk usage which had not been generated ([#951](https://github.com/vmware/govmomi/issues/951)) +- [de717389] Corrects vm.info usage with required args ([#950](https://github.com/vmware/govmomi/issues/950)) +- [c5ea3fb2] Add datastore.disk inflate and shrink commands ([#943](https://github.com/vmware/govmomi/issues/943)) +- [adf4530b] Corrects host.shutdown ([#939](https://github.com/vmware/govmomi/issues/939)) +- [45c5269b] vcsim: add MakeDirectoryResponse ([#938](https://github.com/vmware/govmomi/issues/938)) +- [b4e77bd2] vcsim: copy RoleList for AuthorizationManager ([#932](https://github.com/vmware/govmomi/issues/932)) +- [426a675a] Fix [#933](https://github.com/vmware/govmomi/issues/933) ([#936](https://github.com/vmware/govmomi/issues/936)) +- [3be5f1d9] Add cluster.group and cluster.rule commands ([#928](https://github.com/vmware/govmomi/issues/928)) +- [2a8a5168] vcsim: apply vm spec NumCoresPerSocket ([#930](https://github.com/vmware/govmomi/issues/930)) +- [3a61d85f] vcsim: Configure dvs with the dvs config spec +- [3b25c720] CreateChildDisk 6.7 support ([#926](https://github.com/vmware/govmomi/issues/926)) +- [933ee3b2] Add VirtualDiskManager.CreateChildDisk ([#925](https://github.com/vmware/govmomi/issues/925)) +- [5f0f4004] vcsim: Add VirtualMachine guest ID validation ([#921](https://github.com/vmware/govmomi/issues/921)) +- [ef571547] vcsim: add QueryVirtualDiskUuid ([#920](https://github.com/vmware/govmomi/issues/920)) +- [0ea3b9bd] Implemened vm.upgrade operation. ([#918](https://github.com/vmware/govmomi/issues/918)) +- [27229ab7] vcsim: update ServiceContent to 6.5 ([#917](https://github.com/vmware/govmomi/issues/917)) +- [46c79c93] Add support for cpu + mem allocation to vm.change command ([#916](https://github.com/vmware/govmomi/issues/916)) + + +## [Release v0.16.0](https://github.com/vmware/govmomi/compare/v0.15.0...v0.16.0) + +> Release Date: 2017-11-08 + +### 💫 `govc` (CLI) + +- [0295f1b0] Fix VM clone when source doesn't have vNics +- [4fea6863] add tasks and task.cancel commands +- [ddd32366] add reboot option to host.shutdown + +### 💫 `vcsim` (Simulator) + +- [4543f4b6] preserve order in QueryIpPools ([#914](https://github.com/vmware/govmomi/issues/914)) +- [b385183e] return moref from Task.Run ([#913](https://github.com/vmware/govmomi/issues/913)) +- [e29ab54a] Implement IpPoolManager lifecycle +- [b227a258] add autostart option to power on VMs ([#906](https://github.com/vmware/govmomi/issues/906)) +- [ecde4a89] use soapenv namespace for Fault types +- [b1318195] various property additions +- [c19ec714] Generate similar ref value like VC +- [f3046058] Add moref to vm's summary +- [5f3fba94] validate authz privilege ids +- [c2caa6d7] AuthorizationManager additions +- [2cb741f2] Add IpPoolManager +- [a46ab163] VirtualDisk file backing datastore is optional +- [d347175f] add PerformanceManager +- [df3763d5] Implement add/update/remove roles +- [ed18165d] Generate device filename in CreateVM +- [e8741bf0] add AuthorizationManager +- [8961efc1] populate vm snapshot fields +- [add0245e] Add UpdateNetworkConfig to HostNetworkSystem +- [2aa746c6] Implement virtual machine snapshot +- [104ddfb7] set VirtualDisk backing datastore +- [505b5c65] Implement enter/exit maintenance mode +- [a1f8a328] Implement add/remove license +- [585cf5e1] add portgroup related operations +- [a7e79a7e] add fields support +- [895573a5] remove use of df program for datastore info +- [defe810c] add FileQuery support to datastore search +- [5fcca79e] add HostConfigInfo template +- [920a70c1] add HostSystem hardware property +- [0833484e] Fix merging of default devices +- [f6a734f5] Add cdrom and scsi controller to Model VMs + +### ⚠️ BREAKING + +### 📖 Commits + +- [7d879bac] Doc updates ([#915](https://github.com/vmware/govmomi/issues/915)) +- [4543f4b6] vcsim: preserve order in QueryIpPools ([#914](https://github.com/vmware/govmomi/issues/914)) +- [b385183e] vcsim: return moref from Task.Run ([#913](https://github.com/vmware/govmomi/issues/913)) +- [c8738903] Remove tls-handshake-timeout flag ([#911](https://github.com/vmware/govmomi/issues/911)) +- [e29ab54a] vcsim: Implement IpPoolManager lifecycle +- [3619c1d9] Use ProgressLogger for vm.clone command ([#909](https://github.com/vmware/govmomi/issues/909)) +- [13f2aba4] readme: fix formatting of listing ([#908](https://github.com/vmware/govmomi/issues/908)) +- [b227a258] vcsim: add autostart option to power on VMs ([#906](https://github.com/vmware/govmomi/issues/906)) +- [79934451] Add installation procedure in README.md ([#902](https://github.com/vmware/govmomi/issues/902)) +- [ecde4a89] vcsim: use soapenv namespace for Fault types +- [b1318195] vcsim: various property additions +- [4d8737c9] Switch to kr/pretty package for the -dump flag +- [e050b1b6] Couple of fixes for import.spec result +- [017138ca] import.spec not to assign deploymentOption +- [c19ec714] vcsim: Generate similar ref value like VC +- [0295f1b0] govc: Fix VM clone when source doesn't have vNics +- [f3046058] vcsim: Add moref to vm's summary +- [bfed5eea] [govc] Introduce TLSHandshakeTimeout parameter ([#890](https://github.com/vmware/govmomi/issues/890)) +- [1c1291ca] Support import ova/ovf by URL +- [3cb5cc96] Remove BaseResourceAllocationInfo +- [5f3fba94] vcsim: validate authz privilege ids +- [c91b9605] Add clone methods to session manager +- [c2caa6d7] vcsim: AuthorizationManager additions +- [2cb741f2] vcsim: Add IpPoolManager +- [644c1859] Updates to vm.clone link + snapshot flags +- [cf624f1a] Add linked clone and snapshot support to vm.clone +- [024c09fe] Fix govc events output +- [d4d94f44] govc/events: read -json flag and output events as json +- [24e71ea4] Fix vm.register command template flag +- [5209daf2] Fix object name suffix matching in Finder +- [a46ab163] vcsim: VirtualDisk file backing datastore is optional +- [d347175f] vcsim: add PerformanceManager +- [df3763d5] vcsim: Implement add/update/remove roles +- [8d5c1558] Support clearing vm boot order +- [ed18165d] vcsim: Generate device filename in CreateVM +- [df93050a] Fix CustomFieldsManager.FindKey method signature +- [e8741bf0] vcsim: add AuthorizationManager +- [8961efc1] vcsim: populate vm snapshot fields +- [17fb12a5] Add method to find a CustomFieldDef by Key +- [bc395ef0] vscim: Implement UserDirectory +- [add0245e] vcsim: Add UpdateNetworkConfig to HostNetworkSystem +- [2aa746c6] vcsim: Implement virtual machine snapshot +- [104ddfb7] vcsim: set VirtualDisk backing datastore +- [f3f51c58] Add support for VM export +- [505b5c65] vcsim: Implement enter/exit maintenance mode +- [a1f8a328] vcsim: Implement add/remove license +- [585cf5e1] vcsim: add portgroup related operations +- [a7e79a7e] vcsim: add fields support +- [e2944227] vim25: Move internal stuff to internal package +- [c4cab690] Add support for SOAP request operation ID header +- [895573a5] vcsim: remove use of df program for datastore info +- [4dd9a518] Skip version check when using 6.7-dev API +- [cc2ed7db] Change optional ResourceAllocationInfo fields to pointers +- [3f145230] Use base type for DVS backing info +- [df1c3132] Add vm.console command +- [829b3f99] Fixup recent tasks output +- [c4e473af] Add '-refresh' option to host.storage.info +- [3df440c8] toolbox: avoid race when closing channels on stop +- [badad9a1] toolbox: reset session when invalidated by the vmx +- [a1a96c8f] Include "Name" in device.info -json +- [defe810c] vcsim: add FileQuery support to datastore search +- [93f62ef7] Default vm.migrate pool to the host pool +- [5fcca79e] vcsim: add HostConfigInfo template +- [4fea6863] govc: add tasks and task.cancel commands +- [596e51a0] Use ovf to import vmdk +- [920a70c1] vcsim: add HostSystem hardware property +- [9e2f8a78] Add info about maintenance mode in host.info +- [78f3fc19] Avoid panic if ova import task is canceled +- [11827c7a] toolbox: default to tar format for directory archives +- [8811f9bf] toolbox: make gzip optional for directory archive transfer +- [9703fe19] toolbox: avoid blocking the RPC channel when transferring process IO +- [d6f60304] Add view and filter support to object.collect command +- [3527a5f8] Tolerate repeated Close for file follower +- [ddd32366] govc: add reboot option to host.shutdown +- [4d9061ac] toolbox: use host management IP for guest file transfer +- [7d956b6b] toolbox: add Client Upload and Download methods +- [c7111c63] toolbox: support single file download via archive handler +- [ebb77d7c] Use vcsim in bats tests +- [4bb89668] vCenter cluster testbed automation +- [ad960e95] toolbox: SendGuestInfo before the vmx asks us to +- [bdea7ff3] toolbox: update vmw-guestinfo +- [51d12609] toolbox: remove receiver from DefaultStartCommand +- [114329fc] Add host thumbprint for use with guest file transfer +- [5083a277] Add FindByUuid method for Virtual Machine +- [e1ab84af] toolbox: map exec.ErrNotFound to vix.FileNotFound +- [d1091087] toolbox: pass URL to ArchiveHandler Read/Write methods +- [cddc353c] toolbox: make directory archive read/write customizable +- [ba6720ce] toolbox: add http and exec round trippers +- [b35abbc8] Handle object names containing a '/' +- [ac4891fb] toolbox: fix ListFiles when given a symlink +- [60a6510f] Minor correction in README.md +- [0c583dbc] toolbox: support transferring /proc files from guest +- [0833484e] vcsim: Fix merging of default devices +- [c9aaa3fa] Move toolbox from vmware/vic to govmomi +- [f6a734f5] vcsim: Add cdrom and scsi controller to Model VMs +- [9d47dd13] Move vcsim from vmware/vic to govmomi + + +## [Release v0.15.0](https://github.com/vmware/govmomi/compare/v0.14.0...v0.15.0) + +> Release Date: 2017-06-19 + +### ⚠️ BREAKING + +### 📖 Commits + +- [b63044e5] Release 0.15.0 +- [3d357ef2] Add dvs.portgroup.info usage +- [72977afb] Add support for guest.FileManager directory download +- [94837bf7] Update examples +- [e1bbcf52] Update wsdl generator +- [b16a3d81] fix the WaitOptions struct, MaxWaitSeconds is optional, but we can set the value 0 +- [9ca7a2b5] Support removal of ExtraConfig entries +- [86cc210c] Guest command updates +- [9c5f63e9] Doc updates +- [6d714f9e] New examples: datastores, hosts and virtualmachines using view package +- [f48e1151] update spew to be inline with testify +- [6f5c037c] Adjust message slice passed to include +- [48509bc3] Fix package name +- [6f635b73] Add host.shutdown command +- [67b13b52] Add doc on metric.sample instance flag ([#726](https://github.com/vmware/govmomi/issues/726)) +- [8bff8355] Fix tail n=0 case ([#725](https://github.com/vmware/govmomi/issues/725)) +- [10e6ced9] Update copyright ([#723](https://github.com/vmware/govmomi/issues/723)) +- [6f8ebd89] Allow caller to supply custom tail behavior ([#722](https://github.com/vmware/govmomi/issues/722)) +- [35caa01b] Add options to host.autostart.add ([#719](https://github.com/vmware/govmomi/issues/719)) +- [2030458d] Add VC options command ([#717](https://github.com/vmware/govmomi/issues/717)) +- [0ccad10c] Exported FindSnapshot() Method ([#715](https://github.com/vmware/govmomi/issues/715)) +- [34202aca] Additional wrapper functions for SPBM +- [c7f718b1] Add AuthorizationManager {Enable,Disable}Methods +- [d5e08cd2] Add PBM client and wrapper methods +- [58019ca9] Add generated types and methods for PBM +- [58960380] Regenerate against current vmodl.db +- [f736458f] Support non-Go clients in xml decoder + + +## [Release v0.14.0](https://github.com/vmware/govmomi/compare/v0.13.0...v0.14.0) + +> Release Date: 2017-04-08 + +### ⚠️ BREAKING + +### 📖 Commits + +- [9bfdc5ce] Release 0.14.0 +- [3ba0eba5] Release 0.13.0 +- [86063832] Add object.find command +- [0391e8eb] Adds FindManagedObject method. +- [796e87c8] Include embedded fields in object.collect output +- [2536e792] Use Duration flag for vm.ip -wait flag +- [3aa64170] Merge commit 'b0b51b50f40da2752c35266b7535b5bbbc8659e3' into marema31/govc-vm-ip-wait +- [59466881] Implement EthernetCardBackingInfo for OpaqueNetwork +- [0d2e1b22] Finder: support changing object root in find mode +- [9ded9d10] Add Bash completion script +- [3bd4ab46] Add QueryVirtualDiskInfo +- [16f6aa4f] Emacs: add metric select +- [3763321e] Add unit conversion to metric CSV +- [b0b51b50] Add -wait option to govc vm.ip to allow non-blocking query +- [f0d4774a] Add json support to metric ls and sample commands +- [c9de0310] Add performance manager and govc metric commands +- [d758f694] Add check for nil envelope +- [ab595fb3] Remove deferred Close() call in follower's Read() + + +## [Release v0.13.0](https://github.com/vmware/govmomi/compare/v0.12.1...v0.13.0) + +> Release Date: 2017-03-02 + +### 💫 `vcsim` (Simulator) + +- [5f7efaf1] esxcli FirewallInfo fixes ([#661](https://github.com/vmware/govmomi/issues/661)) + +### ⚠️ BREAKING + +### 📖 Commits + +- [b4a3f7a1] Release 0.13.0 +- [5bf03cb4] Add vm.guest.tools command +- [b4ef3b73] Host is optional for MarkAsVirtualMachine ([#675](https://github.com/vmware/govmomi/issues/675)) +- [f4a3ffe5] Add vsan and disk commands / helpers ([#672](https://github.com/vmware/govmomi/issues/672)) +- [1f82c282] Handle the case where e.VirtualSystem is nil ([#671](https://github.com/vmware/govmomi/issues/671)) +- [dd346974] Remove object.ListView ([#669](https://github.com/vmware/govmomi/issues/669)) +- [4994038a] Wraps the ContainerView managed object. ([#667](https://github.com/vmware/govmomi/issues/667)) +- [93064c06] Handle nil TaskInfo in task.Wait callback [#2](https://github.com/vmware/govmomi/issues/2) ([#666](https://github.com/vmware/govmomi/issues/666)) +- [f1f5b6cb] Handle nil TaskInfo in task.Wait callback ([#665](https://github.com/vmware/govmomi/issues/665)) +- [f3cf126d] Support alternative './...' syntax for finder ([#664](https://github.com/vmware/govmomi/issues/664)) +- [9bda6c3e] Finder: support automatic Folder recursion ([#663](https://github.com/vmware/govmomi/issues/663)) +- [0a28e595] Add a command line option to change an existing disk attached to a VM ([#658](https://github.com/vmware/govmomi/issues/658)) +- [3e95cb11] Attach and list RDM/LUN ([#656](https://github.com/vmware/govmomi/issues/656)) +- [5f7efaf1] vcsim: esxcli FirewallInfo fixes ([#661](https://github.com/vmware/govmomi/issues/661)) +- [17e6545f] Add device option to WaitForNetIP ([#660](https://github.com/vmware/govmomi/issues/660)) +- [ba9e3f44] Fix vm.change test +- [e66c8344] Add the option to describe a VM using the annotation option in ConfigSpec ([#657](https://github.com/vmware/govmomi/issues/657)) +- [505fcf9c] Update doc +- [913c0eb4] Add support for reading and changing SyncTimeWithHost option ([#539](https://github.com/vmware/govmomi/issues/539)) +- [682494e1] Remove _Task suffix from vapp methods +- [733acc9e] Emacs: add govc-command-history +- [ea52d587] Add object.collect command ([#652](https://github.com/vmware/govmomi/issues/652)) +- [f49782a8] Update email address for contributor Bruce Downs + + +## [Release v0.12.1](https://github.com/vmware/govmomi/compare/v0.12.0...v0.12.1) + +> Release Date: 2016-12-19 + +### ⚠️ BREAKING + +### 📖 Commits + +- [6103db21] Release 0.12.1 +- [45a53517] Note 6.5 support +- [fec40b21] Add '-f' flag to logs command ([#643](https://github.com/vmware/govmomi/issues/643)) +- [40cf9f80] govc.el: auth-source integration ([#648](https://github.com/vmware/govmomi/issues/648)) +- [ca99f8de] Add govc-command customization option ([#645](https://github.com/vmware/govmomi/issues/645)) +- [ad6e5634] Avoid Finder panic when SetDatacenter is not called ([#640](https://github.com/vmware/govmomi/issues/640)) +- [b5c807e3] Add storage support to vm.migrate ([#641](https://github.com/vmware/govmomi/issues/641)) +- [1a7dc61e] govc/version: skip first char in git version mismatch error ([#642](https://github.com/vmware/govmomi/issues/642)) +- [6bc730e1] Add Slack links +- [e152c355] Add DatastorePath helper ([#638](https://github.com/vmware/govmomi/issues/638)) +- [5b4d5215] Add support for file backed serialport devices ([#637](https://github.com/vmware/govmomi/issues/637)) +- [f49bd564] Add vm.ip docs ([#636](https://github.com/vmware/govmomi/issues/636)) -* Finder supports Folder recursion without specifying a path + +## [Release v0.12.0](https://github.com/vmware/govmomi/compare/v0.11.4...v0.12.0) -* Add VirtualMachine.QueryConfigTarget method +> Release Date: 2016-12-01 -* Add device option to VirtualMachine.WaitForNetIP +### ⚠️ BREAKING -* Remove _Task suffix from vapp methods +### 📖 Commits -### 0.12.1 (2016-12-19) +- [ab40ac73] Release 0.12.0 +- [e702e188] Disable use of service ticket for datastore HTTP access by default ([#635](https://github.com/vmware/govmomi/issues/635)) +- [1fba1af7] Attach context to HTTP requests for cancellations +- [79cb3d93] Support InjectOvfEnv without PowerOn when importing +- [117118a2] Support stdin as import options source +- [b10f20f4] Don't ignore version/manifest for existing sessions +- [82929d3f] Add basic VirtualNVMEController support +- [757a2d6d] re-generate vim25 using 6.5.0 -* Add DiagnosticLog helper + +## [Release v0.11.4](https://github.com/vmware/govmomi/compare/v0.11.3...v0.11.4) -* Add DatastorePath helper +> Release Date: 2016-11-15 -### 0.12.0 (2016-12-01) +### ⚠️ BREAKING -* Disable use of service ticket for datastore HTTP access by default +### 📖 Commits -* Attach context to HTTP requests for cancellations +- [b9bcc6f4] Release 0.11.4 +- [dbbf84e8] Add authz role helpers and commands +- [765b34dc] Add folder/pod examples +- [79cb52fd] Add host.account examples +- [2a2cab2a] Add host.portgroup.change examples -* Update to vim25/6.5 API + +## [Release v0.11.3](https://github.com/vmware/govmomi/compare/v0.11.2...v0.11.3) -### 0.11.4 (2016-11-15) +> Release Date: 2016-11-08 -* Add object.AuthorizationManager methods: RetrieveRolePermissions, RetrieveAllPermissions, AddRole, RemoveRole, UpdateRole +### ⚠️ BREAKING -### 0.11.3 (2016-11-08) +### 📖 Commits -* Allow DatastoreFile.Follow reader to drain current body after stopping +- [e16673dd] Release 0.11.3 +- [629a573f] Add -product-version flag to dvs.create +- [83028634] Allow DatastoreFile follower to drain current body -### 0.11.2 (2016-11-01) + +## [Release v0.11.2](https://github.com/vmware/govmomi/compare/v0.11.1...v0.11.2) + +> Release Date: 2016-11-01 + +### ⚠️ BREAKING + +### 📖 Commits + +- [cd80b8e8] Release 0.11.2 +- [f15dcbdc] Avoid possible NPE in VirtualMachine.Device method +- [128b352e] Add support for OpaqueNetwork type +- [c5b9a266] Add host account manager support for 5.5 + + +## [Release v0.11.1](https://github.com/vmware/govmomi/compare/v0.11.0...v0.11.1) + +> Release Date: 2016-10-27 + +### ⚠️ BREAKING + +### 📖 Commits + +- [1a7df5e3] Release 0.11.1 +- [1ae858d1] Add support for VirtualApp in pool.change command +- [91b2ad48] Release script tweaks + + +## [Release v0.11.0](https://github.com/vmware/govmomi/compare/v0.10.0...v0.11.0) + +> Release Date: 2016-10-25 -* Avoid possible NPE in VirtualMachine.Device method +### ⚠️ BREAKING + +### 📖 Commits + +- [a16901d7] Release 0.11.0 +- [4fc9deb4] Add object destroy and rename commands +- [82634835] Add dvs.portgroup.change command + + +## [Release v0.10.0](https://github.com/vmware/govmomi/compare/v0.9.0...v0.10.0) + +> Release Date: 2016-10-20 + +### ⚠️ BREAKING + +### 📖 Commits + +- [bb498f73] Release 0.10.0 +- [468a15af] Release script updates +- [1c3499c4] Documentation updates +- [1e52d88a] Update contributors +- [e3d59fd9] Fix snapshot.tree on vm with no snapshots +- [711fdd9c] Add host.date info and change commands +- [16d7514a] Add govc session ls and rm commands +- [73c471a9] Add HostConfigManager field checks +- [d7f94557] Improve cluster/host add thumbprint support +- [fea8955b] Add session.Locale var to change default locale +- [eefe6cc1] Add service ticket thumbprint validation +- [3a0a61a6] Set default locale to en_US +- [aa1a9a84] TLS enhancements +- [9f0e9654] Treat DatastoreFile follower Close as "stop" +- [838b2efa] Support typeattr for enum string types +- [dcbc9d56] Make vm.ip esxcli test optional +- [9e20e0ae] Remove vca references +- [7c708b2e] Adding vSPC proxyURI to govc + + +## [Release v0.9.0](https://github.com/vmware/govmomi/compare/v0.8.0...v0.9.0) -* Add support for OpaqueNetwork type to Finder - -* Add HostConfigManager.AccountManager support for ESX 5.5 - -### 0.11.1 (2016-10-27) - -* Add Finder.ResourcePoolListAll method - -### 0.11.0 (2016-10-25) - -* Add object.DistributedVirtualPortgroup.Reconfigure method - -### 0.10.0 (2016-10-20) - -* Add option to set soap.Client.UserAgent - -* Add service ticket thumbprint validation - -* Update use of http.DefaultTransport fields to 1.7 - -* Set default locale to en_US (override with GOVMOMI_LOCALE env var) - -* Add object.HostCertificateInfo (types.HostCertificateManagerCertificateInfo helpers) - -* Add object.HostCertificateManager type and HostConfigManager.CertificateManager method - -* Add soap.Client SetRootCAs and SetDialTLS methods - -### 0.9.0 (2016-09-09) - -* Add object.DatastoreFile helpers for streaming and tailing datastore files - -* Add object VirtualMachine.Unregister method - -* Add object.ListView methods: Add, Remove, Reset - -* Update to Go 1.7 - using stdlib's context package - -### 0.8.0 (2016-06-30) - -* Add session.Manager.AcquireLocalTicket - -* Include StoragePod in Finder.FolderList - -* Add Finder methods for finding by ManagedObjectReference: Element, ObjectReference - -* Add mo.ManagedObjectReference methods: Reference, String, FromString - -* Add support using SessionManagerGenericServiceTicket.HostName for Datastore HTTP access - -### 0.7.1 (2016-06-03) - -* Fix object.ObjectName method - -### 0.7.0 (2016-06-02) - -* Move InventoryPath field to object.Common - -* Add HostDatastoreSystem.CreateLocalDatastore method - -* Add DatastoreNamespaceManager methods: CreateDirectory, DeleteDirectory - -* Add HostServiceSystem - -* Add HostStorageSystem methods: MarkAsSdd, MarkAsNonSdd, MarkAsLocal, MarkAsNonLocal - -* Add HostStorageSystem.RescanAllHba method - -### 0.6.2 (2016-05-11) - -* Get complete file details in Datastore.Stat - -* SOAP decoding fixes - -* Add VirtualMachine.RemoveAllSnapshot - -### 0.6.1 (2016-04-30) - -* Fix mo.Entity interface - -### 0.6.0 (2016-04-29) - -* Add Common.Rename method - -* Add mo.Entity interface - -* Add OptionManager - -* Add Finder.FolderList method - -* Add VirtualMachine.WaitForNetIP method - -* Add VirtualMachine.RevertToSnapshot method - -* Add Datastore.Download method - -### 0.5.0 (2016-03-30) - -Generated fields using xsd type 'int' change to Go type 'int32' - -VirtualDevice.UnitNumber field changed to pointer type - -### 0.4.0 (2016-02-26) - -* Add method to convert virtual device list to array with virtual device - changes that can be used in the VirtualMachineConfigSpec. - -* Make datastore cluster traversable in lister - -* Add finder.DatastoreCluster methods (also known as storage pods) - -* Add Drone CI check - -* Add object.Datastore Type and AttachedClusterHosts methods - -* Add finder.*OrDefault methods - -### 0.3.0 (2016-01-16) - -* Add object.VirtualNicManager wrapper - -* Add object.HostVsanSystem wrapper - -* Add object.HostSystem methods: EnterMaintenanceMode, ExitMaintenanceMode, Disconnect, Reconnect - -* Add finder.Folder method - -* Add object.Common.Destroy method - -* Add object.ComputeResource.Reconfigure method - -* Add license.AssignmentManager wrapper - -* Add object.HostFirewallSystem wrapper - -* Add object.DiagnosticManager wrapper - -* Add LoginExtensionByCertificate support - -* Add object.ExtensionManager - -... - -### 0.2.0 (2015-09-15) - -* Update to vim25/6.0 API - -* Stop returning children from `ManagedObjectList` - - Change the `ManagedObjectList` function in the `find` package to only - return the managed objects specified by the path argument and not their - children. The original behavior was used by govc's `ls` command and is - now available in the newly added function `ManagedObjectListChildren`. - -* Add retry functionality to vim25 package - -* Change finder functions to no longer take varargs - - The `find` package had functions to return a list of objects, given a - variable number of patterns. This makes it impossible to distinguish which - patterns produced results and which ones didn't. - - In particular for govc, where multiple arguments can be passed from the - command line, it is useful to let the user know which ones produce results - and which ones don't. - - To evaluate multiple patterns, the user should call the find functions - multiple times (either serially or in parallel). - -* Make optional boolean fields pointers (`vim25/types`). - - False is the zero value of a boolean field, which means they are not serialized - if the field is marked "omitempty". If the field is a pointer instead, the zero - value will be the nil pointer, and both true and false values are serialized. - -### 0.1.0 (2015-03-17) - -Prior to this version the API of this library was in flux. - -Notable changes w.r.t. the state of this library before March 2015 are: - -* All functions that may execute a request take a `context.Context` parameter. -* The `vim25` package contains a minimal client implementation. -* The property collector and its convenience functions live in the `property` package. +> Release Date: 2016-09-09 + +### ⚠️ BREAKING + +### 📖 Commits + +- [f9184c1d] Release 0.9.0 +- [e050cb6d] Add govc -h flag +- [a4343ea8] Set default ScsiCtlrUnitNumber +- [a920d73d] Add -R option to datastore.ls +- [f517decc] Fix SCSI device unit number selection +- [abaf7597] Add DatastoreFile helpers +- [7cfa7491] Make Datastore ServiceTicket optional +- [9ad57862] Add vm.migrate command +- [c66458f9] Add govc vm.{un}register commands +- [54c0c6e5] Checking result of reflect.TypeOf is not nil before continuing +- [ea0189ea] Fix flags.NewOptionalBool panic +- [a9cdf437] Add govc guest command tests +- [38dee111] Add VirtualMachine.Unregister func +- [98b50d49] make curl follow HTTP redirects +- [8a27691f] make goreportcard happy +- [bf66f750] Add govc vm snapshot commands +- [eb02131a] Validate vm.clone -vm flag value +- [62159d11] Add device.usb.add command +- [27e02431] Remove a bunch of context.TODO() calls. +- [a9cee43a] Fixing tailing for events command +- [4fa7b32a] Bump to 1.7 and start using new context pkg +- [4b7c59bf] Fix missing datastore name with vm.clone -force=false +- [e3642fce] Fix deletion of powered off vApp +- [63d60025] Support stdin/stdout in datastore upload/download +- [e149909e] Emacs: add govc-session-network +- [0ccc1788] Emacs: add govc json diff +- [f1d6e127] Add host.portgroup.change command +- [6f441a84] Add host.portgroup.info command +- [aaf40729] Add HostNetworkPolicy to host.vswitch.info +- [5ccb0572] Add json support to host.vswitch.info command +- [9d19d1f7] Support instance uuid in SearchFlag +- [2d3bfc9f] Add json support to esxcli command +- [bac04959] Support multiple NICs with vm.ip -esxcli +- [b3177d23] Add -unclaimed flag to host.storage.info command +- [b1234a90] govc - popualte 'Path' fiels in xxx.info output +- [7cab0ab6] Implemented additional ListView methods +- [498cb97d] Add 'Annotation' attribute to importx options. +- [223168f0] Add NetworkMapping section to importx options. +- [5c708f6b] Remove vendor target from the Makefile +- [f8199eb8] Handle errors in QueryVirtualDiskUUid function ([#548](https://github.com/vmware/govmomi/issues/548)) +- [73dcde2c] vendor github.com/davecgh/go-spew/spew +- [e1e407f7] vendor golang.org/x/net/context +- [e3c3cd0a] Populate network mapping from ovf envelope ([#546](https://github.com/vmware/govmomi/issues/546)) +- [fa6668dc] Add QueryVirtualDiskUuid function ([#545](https://github.com/vmware/govmomi/issues/545)) +- [17682d5b] Fixes panic in govc events + + +## [Release v0.8.0](https://github.com/vmware/govmomi/compare/v0.7.1...v0.8.0) + +> Release Date: 2016-06-30 + +### ⚠️ BREAKING + +### 📖 Commits + +- [c0c7ce63] Release 0.8.0 +- [ce4b0be6] Disable datastore service ticket hostname usage +- [3e44fe88] Add support for login via local ticket +- [acf37905] Add StoragePod support to govc folder.create +- [94d4e2c9] Include StoragePod in Finder.FolderList +- [473f3885] Avoid use of eval with govc env +- [4fb7ad2e] Add datacenter.create folder option +- [77ea6f88] Avoid vm.info panic against vcsim +- [95b2bc4d] Session persistence improvements +- [720bbd10] Add type attribute to soap.Fault Detail +- [ff7b5b0d] Add filtering for use of datastore service ticket +- [fe9d7b52] Add support for Finder lookup via moref +- [c26c7976] Use ticket HostName for Datastore http access +- [bea2a43c] Add govc/vm.markasvm command +- [9101528d] Add govc/vm.markastemplate command +- [982e64b8] Add vm.markastemplate + + +## [Release v0.7.1](https://github.com/vmware/govmomi/compare/v0.7.0...v0.7.1) + +> Release Date: 2016-06-03 + +### ⚠️ BREAKING + +### 📖 Commits + +- [2cad28d0] Fix Datastore upload/download against VC + + +## [Release v0.7.0](https://github.com/vmware/govmomi/compare/v0.6.2...v0.7.0) + +> Release Date: 2016-06-02 + +### ⚠️ BREAKING + +### 📖 Commits + +- [6906d301] Release 0.7.0 +- [558321df] Move InventoryPath field to object.Common +- [4147a6ae] Add -require flag to govc version command +- [d9fd9a4b] Add support for local type in datastore.create +- [650b5800] Fix vm.create disk scsi controller lookup +- [9463b5e5] Update changelog for govc to add datastore -namespace flag +- [4aab41b8] Update changelog with DatastoreNamespaceManager methods +- [4d6ea358] Support mkdir/rm of namespace on vsan +- [bb7e2fd7] InjectOvfEnv() should work with VSphere +- [91ca6bd5] Add host.service command +- [2f369a29] Add host.storage.mark command +- [b001e05b] Add -rescan option to host.storage.info command + + +## [Release v0.6.2](https://github.com/vmware/govmomi/compare/v0.6.1...v0.6.2) + +> Release Date: 2016-05-13 + +### ⚠️ BREAKING + +### 📖 Commits + +- [9051bd6b] Release 0.6.2 +- [3ab0d9b2] Get complete file details in Datastore.Stat +- [0c21607e] Convert types when possible +- [648d945a] Avoid xsi:type overwriting type attribute +- [4e0680c1] adding remove all snapshots to vm objects + + +## [Release v0.6.1](https://github.com/vmware/govmomi/compare/v0.6.0...v0.6.1) + +> Release Date: 2016-04-30 + +### ⚠️ BREAKING + +### 📖 Commits + +- [18154e51] Release 0.6.1 +- [47098806] Fix mo.Entity interface + + +## [Release v0.6.0](https://github.com/vmware/govmomi/compare/v0.5.0...v0.6.0) + +> Release Date: 2016-04-29 + +### ⚠️ BREAKING + +### 📖 Commits + +- [2c1d977a] Release 0.6.0 +- [cc686c51] Add folder.moveinto command +- [8e85a8d2] Add folder.{create,destroy,rename} methods +- [0ba22d24] Add Common.Rename method +- [61792ed3] Fix Finder.FolderList check +- [b6be92a1] Restore optional DatacenterFlag +- [53903a3a] Add OutputFlag support to govc about command +- [e66f7793] Add OptionManager and host.option commands +- [9d69fe4b] Add debug xmlformat script +- [f1786bec] Add option to use the same path for debug runs +- [99c8c5eb] Add folder.info command +- [eca4105a] Add datacenter.info command +- [71484c40] Add mo.Entity interface +- [388df2f1] Add helper to wait for multiple VM IPs +- [fc9f58d0] Add RevertToSnapshot +- [a4aca111] Add govc env command +- [ef17f4bd] Update CI config +- [fa91a600] Add host.account commands +- [44bb6d06] Update release install instructions +- [08ba4835] Leave AddressType empty in EthernetCardTypes +- [f9704e39] Add vm clone +- [e6969120] Add datastore.Download method +- [1aca660c] device.remove: add keep option + + +## [Release v0.5.0](https://github.com/vmware/govmomi/compare/v0.4.0...v0.5.0) + +> Release Date: 2016-03-30 + +### ⚠️ BREAKING + +### 📖 Commits + +- [c1b29993] Release 0.5.0 +- [b8549681] Use VirtualDeviceList for import.vmdk +- [cf96f70d] Remove debug flags from pool tests +- [f74a896d] Switch to int32 type for xsd int fields +- [074494df] Regenerate against 6.0u2 wsdl +- [ce9314c4] Include license header in generated files +- [957c8827] Add pointer field white list to generator +- [2c1d1950] Change pool recusive destroy to children destroy +- [5d34409f] Add dvs.portgroup.info command +- [216031c3] Update docs +- [f7dfcc98] Remove govc-test pools in teardown hook +- [556a9b17] Simplify pool destroy test +- [4e47b140] Add folder management to vm.create +- [7c33bcb3] Update test ESX IP in Drone secrets file +- [1b6ec477] Regenerate Drone secrets file +- [f64ea833] Implemented the ablitiy to tail the vSphere event stream - govc tail and force flag added to events command +- [fd7d320f] Including github.com/davecgh/go-spew/spew in go get +- [1d4efec0] Including github.com/davecgh/go-spew/spew in go get +- [424d3611] The -dump option now requests a recursive traversal as -json does +- [b45747f3] Added new -dump output flag for pretty printing underlying objects using davecgh/go-spew +- [a243716c] Run govc tests against ESX using Drone +- [fb75c63e] Double quotes network name to prevent space in name from failing the tests +- [564944ba] test_helper.bash updated to conditionally set env variables +- [c9c6e38f] Added new govc vm.disk.create -mode option for selecting one the VirtualDiskMode types +- [6922c88b] Add -net flag to device.info command +- [dff2c197] Fix VirtualDeviceList.CreateFloppy +- [c7d8cd3e] Ran gofmt on create.go +- [e077bcf5] Fix issue with optional UnitNumber (v2) +- [539ad504] Added arguments to govc vm.disk.create for thick provisioning and eager scrubbing, as requested in issue [#254](https://github.com/vmware/govmomi/issues/254) +- [e66c6df9] Handle import statement for types too +- [265d8bdb] Remove hardcoded urn:vim25 value from vim_wsdl.rb + + +## [Release v0.4.0](https://github.com/vmware/govmomi/compare/v0.3.0...v0.4.0) + +> Release Date: 2016-02-26 + +### ⚠️ BREAKING + +### 📖 Commits + +- [b3d202ab] Release 0.4.0 +- [749da321] Fix vm.change's ExtraConfig values being truncated at equal signs +- [13fbc59d] Add switch to specify protocol version in SOAPAction header +- [07013a97] Update CHANGELOG +- [bfe414fe] Allow vm.create to take datastore cluster argument +- [dda71761] Include reference to datastore in CreateDisk +- [855abdb3] Make NewKey function public +- [d0031106] Use custom datastore flags in vm.create +- [306b613d] Modify govc's vm.create to create VM in one shot +- [e96130b4] Add extra datastore arguments to vm.create +- [0a2da16d] Add datastore cluster methods to finder +- [c69e9bc1] Allow StoragePod type to be traversed +- [4d2ea3f4] added explicit path during clone +- [3d8eb102] Update missing property whitelist +- [779ae0a1] re-generate vim25 using 6.0 Update 1b (vimbase [#3024326](https://github.com/vmware/govmomi/issues/3024326)) +- [53c29f6a] Handle import statements same as include +- [a738f89d] Update govc.el URL +- [da2a249e] Doc updates +- [47e46425] govc.el: minor fixes for distribution as a package +- [8459ceb9] handle GOVC_TEST_URL=user:pass[@IP](https://github.com/IP) pattern +- [3b669760] Add Emacs interface to govc +- [7ec8028d] Update README to include Drone build status and local build instructions +- [2ec65fbe] Add config for Drone CI build +- [5437c466] introduce Datastore.Type() +- [983571af] introduce IsVC method and start using it +- [0732f137] Introduce AttachedClusterHosts +- [18945281] start using new helper functions for govc/flags +- [044d904a] Add some common functions to find/finder.go +- [534dabbd] Support vapp in pool.info command +- [4d9c6c72] Fix bats tests +- [5e04d5ca] Add -p and -a options to govc datastore.ls command +- [33963263] Added check for missing ovf deployment section + + +## [Release v0.3.0](https://github.com/vmware/govmomi/compare/v0.2.0...v0.3.0) + +> Release Date: 2016-01-15 + +### ⚠️ BREAKING + +### 📖 Commits + +- [501f6106] Mark 0.3.0 in change log +- [83a26512] Update contributors +- [995d970f] Print os.Args[0] in error messages +- [0a4c9782] Move stat function to object.Datastore +- [8a0d4217] Support VirtualApp in the lister +- [82734ef3] Support empty folder in SearchFlag.VirtualMachines +- [f64f878f] Add support for custom session keep alive handler +- [2d498658] Use OptionalBool for ExpandableReservation +- [ac9a39b0] Script to capture vpxd traffic on VCSA +- [3f473628] Script to capture and decrypt hostd SOAP traffic +- [eccc3e21] Move govc url.Parse wrapper to soap.ParseURL +- [e1031f44] Don't assume sshClient firewall rule is disabled +- [cd5d8baa] Let the lister recurse into a ComputeHost +- [b601a586] Specify the new entity's name upon import +- [a5e26981] Explicitly instantiate and register flags +- [aca77c67] Parameterize datastore in VM tests +- [37324472] Pass context to command and flag functions +- [6f955173] Minor optimization to encoding usage +- [0f4aee8b] Create VMFS datastore with datastore.create +- [ec724783] Add host storage commands +- [debdd854] Run license script +- [64022512] Fix license script to work for uncommitted files +- [5cb0c344] Remove host reference from HostFirewallSystem +- [4fb4052a] Change the comment that mentions ha-datacenter +- [b76ad0eb] Let the ESXi to figure out datastore name +- [918188dc] Add helper method to get VM power state +- [29a2f027] Add permissions.{ls,set,remove} commands +- [f27787a1] Add DatacenterFlag.ManagedObjects helper +- [0e629647] Option to disable API version check +- [42d899d0] Add commands to add and remove datastores +- [369e0e7f] Check host state in Datastore.AttachedHosts +- [7adf8375] Test that vm.info -r prints mo names +- [3198242e] Change ComputeResource.Hosts to return HostSystem +- [b34f346e] Support property collection for embedded types +- [8035c180] Fix vm nested hv option +- [b1d9d3c2] Update copyright years in code headers +- [c99e7bac] Add dvs commands +- [c30b7f17] Support DVS lookup in finder +- [094fbdfe] Embed Reference interface in NetworkReference +- [0657cf76] Add DVS helpers +- [6e96a1db] Add host.vnic.{service,info} commands +- [ae6b0b77] Add VsanSystem and VirtualNicManager wrappers +- [24297494] Add vsan flags to cluster.change command +- [4088502d] Add license.assigned.list id flag +- [d089489e] Add cluster.add license flag +- [31ee6e03] Add vm.change options to set hv/mmu +- [a414852e] Refactor host.add command to use HostConnectFlag +- [51543392] Add cluster.{create,change,add} commands +- [8262e1da] Add cluster related host commands +- [2443b364] Add HostConnectFlag +- [8ae7da82] Add object.HostSystem methods +- [0f630dd9] Add finder.Folder method +- [7cd5fbb5] Add bash function to save/load GOVC environments +- [12f26c21] Add object.Common.Destroy method +- [2ab8aa59] Add ComputeResource.Reconfigure method +- [5f47f155] Add flags.NewOptionalBool +- [25fe42b2] Add -feature flag to license list commands +- [2e6c0476] Add license.InfoList list wrapper +- [ef7371af] Add license assignment commands +- [5005e6e4] Add license.AssignmentManager +- [69a23bd4] Use object.Common in license.Manager +- [dbce3faf] Rename receiver variable for consistency +- [80705c11] Pass pointer to bps uint64 in last progress report +- [26e77c8e] VirtualMachine: Add Customize function on object.VirtualMachine +- [c2a78973] Add license.decode command +- [b3a7e07e] Add DistributedVirtualPortgroup support to vm.info +- [1b11ad02] Fix KeepAlive +- [3ecfd0db] Add HostFirewallSystem wrapper +- [9ded9c1a] KeepAlive support with certificate based login +- [cf2a879b] Add DiagnosticManager and logs commands +- [7b14760a] Update README.md +- [ad694500] Export Datastore.ServiceTicket method +- [76690239] Added a method to create snapshot of a virtual machine +- [6d4932af] Use service ticket for datastore file access +- [5fcc29f6] Fix vcsa ssh config +- [ac390ec8] Retry on empty result from property collector +- [f3041b2c] Add methods for client certificate based auth +- [b9edc663] Add extension manager and govc commands +- [9057659c] Fix key composition in building OVF spec +- [f56f6e80] Move OVF environment related code to env{,test}.go +- [b33c9aef] Add minimal doc to ovf package +- [3d40aefb] Added verbose option to the import.spec feature +- [1df0a81d] change for looking up a VM using instanceUUID +- [5f4d36cd] Introduce govc vapp.{info|destroy|power} +- [88795252] Handle the import.spec case where no spec file is provided +- [bcdc53fb] Add inventory path to govc info commands +- [305371a8] Collect govc host and pool info in one call +- [bfd47026] Relax the convention around importing an ova +- [3742a8aa] don't start goroutine while context is nil + + +## [Release v0.2.0](https://github.com/vmware/govmomi/compare/v0.1.0...v0.2.0) + +> Release Date: 2015-09-15 + +### ⏮ Reverts + +- [2900f2ff] Add Host information to vm.info +- [8bec13f7] Fix git dirty status error in build script + +### ⚠️ BREAKING + +### 📖 Commits + +- [b3315079] Mark 0.2.0 in change log +- [cc3bcbee] Add mode argument to release script +- [ae4a6e53] Build govc with new cross compilation facilities +- [4708d165] Derive CONTRIBUTORS from commit history +- [00909f48] Move contrib/ -> scripts/ +- [a0f4f799] Capitalization +- [13baa0e4] Split import functionality into independent flags +- [6363d0e2] Added ovf.Property output to import.spec +- [7af121df] Update change log +- [f9deb385] Fix event.Manager category cache +- [7f0a892d] Avoid tabwriter in events command +- [29601b46] Use vm.power force flag for hard shutdown/reboot +- [ea833cf5] Add VirtualDiskManager CreateVirtualDisk wrapper +- [bfabd01d] Interative clean up of bats testing +- [7cba62d9] Clean up of vcsa creation script +- [631d6228] Add serial port URI info to device.info output +- [0b31dcff] Add -json support to device.info command +- [54e324d1] Add govc vm.info resources option +- [9cc5d8f5] Add helper method to wait for virtual machine power state. +- [9ddd6337] Remove superfluous math.Pow calculations +- [5272b1e9] Added common method of humanizing byte strings +- [3145d146] Add helper method to check if VMware Tools is running in the guest OS. +- [e4f4c737] Misc clean up +- [01f2aed0] Add host name to vm.info +- [f24ec75a] Use property.Collector.Retrieve() in vm.info +- [a779c3b7] Renamed vm.info VmInfos back to VirtualMachines +- [2900f2ff] Revert "Add Host information to vm.info" +- [2a567478] Add -hints option to host.esxcli command +- [1f0708e2] Add options to importing an ovf or and ova file +- [debde780] Only retrieve "currentSession" property +- [b5187c16] Update CONTRIBUTORS +- [3e4ced8c] Added the ability to specify ovf properties during deployment +- [688a6b18] Introduce more VirtualApp methods +- [b1f0cb0c] Add flag to specify destination folder for import.ovf and import.ova +- [c9fcf1ce] Add check for error reading ova file +- [edb0a2cf] clone vmware/rbvmomi repo if it's missing +- [40c26fc6] use e.Object.Reference().Type as suggested by Doug +- [c1442f95] introduce CreateVApp and CreateChildVM_Task +- [25405362] add VirtualAppList and VirtualApp methods to Finder +- [121f075c] Add CustomFieldsManager wrapper and cli commands +- [dd016de3] include VirtualApp in ls -l output +- [b5db4d6d] Provide ability to override url username and password +- [11d5ae9c] Add OVF unmarshalling +- [135569e7] Update travis.yml for new infra +- [822432eb] Make govet stop complaining +- [baf9149e] Add datastore.info cli command +- [2b93c199] Add serial port matcher to SelectByBackingInfo +- [26ba22de] Merge branch 'gavrie-master' +- [62591576] Add Host information to vm.info +- [a90019ab] Add methods for useful properties to VirtualMachine +- [502963c4] Add Relocate method to VirtualMachine +- [7f4b6d38] Add String method to objects for pretty printing +- [99f57f16] Add events helpers and cli command +- [4c989ac3] Update CONTRIBUTORS +- [ad7d1917] Update to vim25/6.0 API +- [ad39adb9] Add net.address flag +- [e01555f9] Add command to add host to datacenter +- [efbd3293] Stop returning children from `ManagedObjectList` +- [d16670f5] Update CONTRIBUTORS +- [97fbf898] Mention GOVC_USERNAME and GOVC_PASSWORD in CHANGELOG +- [8766bda0] Add test to check for flag name collisions +- [791b3365] Remove flags for overriding username and password +- [85957949] include GOVC_USERNAME and GOVC_PASSWORD in govc README +- [8584259a] Export variables in release script +- [14889008] Add test for GOVC_USERNAME and GOVC_PASSWORD +- [c0a984cd] Only run license tests against evaluation license +- [293ac813] Allow override of username and password +- [e053bdf2] Add extraConfig option to vm.change and vm.info +- [1dec0695] Update CONTRIBUTORS +- [1acf418c] Add Usage for host.esxcli +- [2e00fdb1] Modify archive.go bug +- [985291d5] Add missing types to list.ToElement +- [871f5d4f] Add script to create a draft prerelease +- [8bec13f7] Revert "Fix git dirty status error in build script" +- [c825a3c7] Only use annotated tags to describe a version +- [66320cb0] Retry twice on temporary network errors in govc +- [67be5f1d] Add retry functionality to vim25 package +- [fba0548b] Add method to destroy a compute resource +- [2add2f7a] Add methods to add standalone or clustered hosts +- [de297fcb] Add ability to create, read and modify clusters +- [f10480af] Change finder functions to no longer take varargs +- [4bc93a66] Fix resource pool creation/modification +- [b434a9a8] Rename persist flag to persist-session +- [d85ad215] Ignore ManagedObjectNotFound in list results +- [4c497373] Add example that lists datastores +- [5d153787] Update govc CHANGELOG +- [0165e2de] Add flag to toggle persisting session to disk +- [8acb2f28] Add Mevan to CONTRIBUTORS +- [add15217] Ignore missing environmentBrowser field +- [447d18cd] Fix error when using SDRS datastores +- [e85f6d59] Find ComputeResource objects with find package +- [55f984e8] Test package only depends on vim25 +- [dbe47230] Drop omitempty tag from optional pointer fields +- [749f0bfa] Interpret negative values for unsigned fields +- [49a34992] Update CHANGELOG +- [263780f3] Update code to work with bool pointer fields +- [93aad8da] Make optional bool fields pointers +- [b7c51f61] Return errors for unexpected HTTP statuses +- [62ca329a] Abort client tests on errors +- [ae345e7f] Rename LICENSE file +- [a783a8c6] Add govc CHANGELOG +- [ba707586] Add commands to configure the autostart manager +- [af6a188e] Re-enable search index test +- [ceea450c] Update govc README +- [ea5c9a52] Fix git dirty status error in build script + + +## v0.1.0 + +> Release Date: 2015-03-17 + +### ⚠️ BREAKING + +### 📖 Commits + +- [477dcaf9] Cross-compile govc using gox +- [8593d9c7] Add version variable that can be set by the linker +- [fb38ca45] Add CHANGELOG +- [76f8f1a1] Add package docs to client.go +- [27bf35df] Use context.Context in client in root package +- [f3b8162f] Comment out broken test +- [a1d9d1e7] Drop the _gen filename suffix +- [91650a1f] Add context.Context argument to object package +- [1814113a] Use vim25.Client throughout codebase +- [b977114e] Move property retrieval functions to property package +- [8c3243d8] Add lightweight client structure to vim25 package +- [ec4b5b85] Add context.Context argument to find/list packages +- [7eecfbc7] Make Wait function in property package standalone +- [6c1982c8] Add keep alive for soap.RoundTripper +- [1324d1f0] Return nil UserSession when not authenticated +- [ae7ea3dd] Comments for task.Wait +- [a53a6b2c] Add context parameter to object.Task functions +- [f6f44097] Move functionality to wait for task to new package +- [ad2303cf] Move Ancestors function to vim25/mo +- [fb9e1439] Move PropertyCollector to new property package +- [a6618591] Move Reference to vim25/mo +- [bfdb90f1] Bind virtual machine to guest operation wrappers +- [ec0c16a7] Move HasFault to vim25/types +- [683ca537] Move wrappers for managed objects to object package +- [223a07f8] Add GetServiceContent function to vim25/soap +- [25b07674] Decouple factory functions from client +- [b96cf609] Move SessionManager to new session package +- [ea8d5d11] Return on error in SessionManager +- [7d58a49e] Mutate copy of parameter instead of parameter itself +- [e158fd95] Marshal soap.Client instead of govmomi.Client +- [1336ad45] Embed soap.Client in govmomi.Client +- [15cfd514] Work with pointer to url.URL +- [be2936f8] Move guest related wrappers to new guest package +- [b772ba28] Move LicenseManager to new license package +- [7ac1477f] Move EventManager to new event package +- [2053e065] Retrieve dependencies before running test +- [2d14321e] Add context.Context argument to RoundTripper +- [64f716b2] Include type of request in summarized debug log +- [40249c87] Store reference to http.Transport +- [ac77f0c5] Move debugging code in soap.Client to own struct +- [c8fab31b] Loosen .ovf match in ova.import +- [9f685e92] And further fixing the merge... go fmt. +- [8dbb438b] Merge remote-tracking branch 'upstream/master' into event_manager +- [e57a557c] created session manager wrapper +- [5525d5c6] Change return pattern in CreateDatacenter +- [8acd5512] Update contributors +- [7138d375] Coding style consistency +- [951e9194] added SessionIsActive to Client +- [2211e73d] Add CreateFolder method +- [eef40cc0] Add Login/Logout functions to client struct +- [3c7dea04] Update contributors +- [9c4a9202] Fixed error when attempting to access datastore +- [05ee0e62] Add PropertiesN function on client struct +- [01ee2fd5] Adding EventManager so that events can be queried for +- [8d10cfc7] Restrict permissions on session file +- [88b5d03c] Key session file off of entire URL +- [9354d314] Error types for getter functions on finder +- [a30287dc] Add description for pool.create +- [77466af0] Prefix option list in help output +- [cbb8d0b2] Create multiple resource pools through pool.create +- [8d4699d8] Add usage and description for pool.destroy +- [2e195a92] Change pool.change to take multiple arguments +- [38e4a2b2] Add usage and description for pool.info +- [2f286768] Add usage and description for pool.create +- [413fa901] Set insert_key = false +- [d6c2b33e] Update travis.yml +- [b878c20a] Adding CustomizationSpecManager +- [7c8f3e56] Add vm mark as vm and mark as template features +- [033d02e9] Update contributors +- [18919172] Add cpu and memory usage to host.info +- [b29f93c1] Adding the RegisterVM task. +- [e6bf8bb5] Add error types for Finder +- [852578b9] Support multiple hosts in host.info command +- [f1899c63] Set InventoryPath field +- [3a5c1cf3] Add InventoryPath field +- [624f21a4] Add resource pool cli commands +- [4c7cd61f] Add ResourcePool wrapper methods +- [761d43e5] Include ResourcePool in ls -l output +- [d2daf706] Support nested resource pools in lister +- [4d9d9a72] Add vm.change cli command +- [e6ebcd7f] bats fixup: destroy datacenter +- [65838131] Disable vcsa box password expiration +- [7a6e737b] Add CONTRIBUTORS file +- [1cbe968d] Issue [#192](https://github.com/vmware/govmomi/issues/192): HostSystem doesn't seem to be returning the correct host. +- [116a4044] fix a problem of ignored https_proxy environment variable with https scheme +- [df423c32] Add create and destroy datacenter to govc. +- [035bd12c] Usage for devices.{cdrom,floppy}.* +- [68e50dd3] make storage resource manager +- [b28d6f42] Specify default network in test helper +- [4b388e67] Fix boot order test +- [4414a07e] Expand vm.vnc command +- [e329e6e7] rename the session file for windows naming check +- [706520fa] use filepath for filesystem related path operations +- [ceb35f13] Add -f flag to datastore.rm +- [6498890f] Default VM memory to 1GiB +- [591b74f4] Include description for device.cdrom commands +- [815f0286] Add usage to device.cdrom.insert +- [f2209c2b] Flag description casing +- [5e52668c] Add usage to import commands +- [23cf4d35] Expand datastore.ls +- [bca8ef73] Expose underlying VimFault through Fault() function +- [90edb2bc] Add Usage() function to subset of commands +- [afdc145a] Implement subset of license manager +- [14765d07] Add net.adapter option to network flag +- [18c2cce0] Add CreateEthernetCard method +- [9b2730f0] Don't run vm.destroy if there is no input +- [611ced85] Add new ops to vm.power command +- [6cd9f466] Add VM power ops +- [7918063c] Work on README +- [db17cddd] Check minimum API version from client flag +- [df075430] Don't run datastore.rm if there is no input +- [e49a6d57] Move environment variables names into constants +- [2cfe267f] Add device.scsi command +- [6df44c1a] Support scsi disk.controller type in vm.create +- [39a60bbf] Add CreateSCSIController method +- [136fabe5] Rename vm.create disk.adapter to disk.controller +- [9c51314c] Change disk related commands to use new helpers +- [b0c895e5] Add VirtualDisk support to device helpers +- [a00f4545] Add helpers for creating disks +- [16283936] Add FindDiskController helper +- [dda056dc] Add VirtualDeviceList.FindSCSIController method +- [5402017a] FindByBackingInfo -> SelectByBackingInfo +- [0ff5759c] Add vm disk related bats tests +- [8f1e183a] Output disk file backing in device.info +- [e7cfba4b] Remove datastore test files +- [6b883be5] Use DeviceAdd helper in vm.network.add command +- [eb5881ae] Use device name in vm.network.change command +- [b7503468] Remove vm.network.remove command +- [0b81619a] Add vm.network.change cli command +- [0af5c4cf] Use VirtualDeviceList helpers in vm.network.remove +- [94c62da0] Add VirtualDeviceList FindByBackingInfo method +- [c247b80c] Move govc resource finders to govmomi/find package +- [5f0c8dd4] Add vm.info bats test +- [5d99454d] mv govc/flags/list -> govmomi/list +- [028bd3ff] Fix HostSystem.ResourcePool with cluster parent +- [48e25166] Add ls bats test +- [c5f24bce] Add host bats test +- [f965c9ad] Add default GOVC_HOST to vcsim_env +- [77fc8ade] Add network flag required test +- [b1236bf8] Add wrapper to manually run govc against vcsim +- [68831a1f] Fix network device.remove test +- [4649bf1f] Default vcsim box to 4G memory +- [b3f71333] Simplify vcsim_env helper +- [2ca11cde] Answer pending VM questions from govc +- [b6c3ff31] Move govc/test Vagrant boxes +- [b1b5b26e] Change network flag to use NetworkReference +- [83f49af7] Add network bats test +- [a8ffa576] Add NetworkReference interface +- [6fe62e29] Add vcsim_env helper +- [a616817d] Fix collapse_ws helper +- [0614961e] Add DistributedVirtualPortgroup constructor +- [1ddf6801] Cache esxcli command info +- [c713b974] Add table formatter to esxcli command +- [fd19a011] Include esxcli method info in response +- [3c9a436f] Explicit exit status check in assert_failure +- [5a63bc06] Collapse whitespace in assert_line helper +- [c9bd4312] Change vm.ip -esxcli to wait for ip +- [e97e5604] boot order test fixups +- [0e128e0d] 32M is plenty of memory for ttylinux +- [85ded933] Add test cleanup script +- [2bc707e7] Add device.serial cli commands +- [17fb283a] Add serial port device related helpers +- [d9b846d1] Add device.boot tests +- [b5a21e4e] Add device.floppy cli commands +- [d1d39fc3] Add floppy device related helpers +- [1e2c54c0] Refactor disk logic into disk.go +- [9dff8e74] Fix attach disk error checks +- [0f352ec3] Add vm.disk.attach +- [bdd7b37b] Refactor vm.disk.add to vm.disk.create +- [ae2e990e] Add govc functional tests +- [a707fae6] Fix alignment for 32-bit go +- [13274292] Default cli client url.User field +- [17df67ad] Add device.boot cli command +- [3c345ad7] Add device.ls -boot option +- [3b25234c] Add boot order related VirtualDeviceList helpers +- [f996c7d0] Add VirtualMachine BootOptions wrappers +- [4f3b935b] Add some DeviceType constants +- [86f90c52] Add VirtualDeviceList.Type method +- [5f3b95d7] Output MAC Address in device.info +- [58c3c64e] Add VirtualMachineList.PrimaryMacAddress helper +- [67fea291] Fix import.ovf with relative ovf source path +- [22602029] Support non-disk files in import.ovf +- [92175548] Add Upload.Headers field +- [f095536d] Fix import.ova command +- [5093303a] Add device related govc commands +- [18644254] Add device list related helpers +- [6803033e] Add device list helpers +- [4f8cd87c] Switch to BaseOptionValue for vm extra config +- [76662657] Regenerate types +- [46ec389f] Generate interface types for all base types +- [f78df469] Remove Client param from ResourcePool methods +- [ca3cd417] Add Client reference to ResourcePool +- [ffc306cc] Add Client reference to Network +- [c1138fc4] Remove Client param from HttpNfcLease methods +- [6f983a49] Add Client reference to HttpNfcLease +- [d2d566d0] Remove Client param from HostSystem methods +- [60bf1770] Add Client reference to HostSystem +- [e32542c1] Remove Client param from HostDatastoreBrowser methods +- [8956959a] Add Client reference to HostDatastoreBrowser +- [79e7da1d] Remove Client param from Folder methods +- [68b3e6dc] Add Client reference to Folder +- [da5b8ec0] Remove Client param from Datastore methods +- [f89dd25a] Add Client reference to Datastore +- [1b372efa] Remove Client param from Datacenter methods +- [ce320403] Add Client reference to Datacenter +- [b99a9529] Remove Client param from VirtualMachine methods +- [eb700d65] Add Client reference to VirtualMachine +- [673485e4] Remove config check from esxcli.GuestInfo.IpAddress +- [667df16a] Add VCSA Vagrant box +- [66b7daab] Use single consistent pattern to populate FlagSet +- [8fa06b5a] Export NewReference function +- [a4e11a3a] Check if info is nil before using it +- [8bbe7361] Add ManagedObject wrappers +- [9d5df71d] Add vm.ip -esxcli option +- [1818a2a6] Add esxcli helper for guest related info +- [ac6efdc9] Use vim.CLIInfo for esxcli command flags and help +- [5b9b34bc] Remove Cdrom function from disk flag +- [01d201ee] Use new esxcli command parser +- [7531d60e] New esxcli command parser +- [a27c9bd5] Refactor esxcli to esxcli.Executor +- [fdb2d2d0] Refactor unmarshal +- [2dd9910d] Add esxcli related types and methods +- [aad819e8] Add IsoFlag +- [df11fc04] Handle empty values in esxcli +- [6ceff6a4] Fix default network in NetworkFlag +- [bc39649d] Add DistributedVirtualPortgroup wrapper +- [a7eb1d1e] Add DVS support to NetworkFlag +- [71898a73] Support DistributedVirtualPortgroup in lister +- [1cf31f03] Regenerate mo types +- [1e7c1957] Generate mo types regardless of props +- [549a2712] tasks are no longer generated +- [fcf2cd94] Remove unused DiskFlag.Copy method +- [e494c312] Add DiskFlag adpater option +- [71e5eea2] Add host.esxcli command +- [5d0fe65c] Replace panic by error in host system flag +- [a2a7c8ff] Remove newOvf() +- [d8e94d8f] Use default host system where possible +- [67835263] Move HostNetworkSystem getter to HostSystemFlag +- [348258b5] Move resource pool getter to host system object +- [03f94f4b] Default URL scheme and path if not specified +- [73b11f40] Move progress reader to vim25/progress +- [34f73f0a] Refactored progress reporting infrastructure +- [79f15899] Include environment variable names in help +- [1de37e80] Don't skip certificate verification by default +- [4a533b21] Support ClusterComputeResource in list flag +- [817df9d1] Include remote path in importable +- [a0944d82] Import vm.network commands +- [2fd2f026] Add vm.network.remove command +- [e3307b6f] Add vm.network.add command +- [2ac39a1e] Import host.portgroup commands +- [27686532] Add host.portgroup.remove command +- [46545dd9] Add host.portgroup.add command +- [29d8ed38] Add host.vswitch.remove command +- [c2bfbccf] Add host.vswitch.info command +- [f05e3e0a] Include host/vswitch commands +- [17094882] Add host.vswitch.add cli command +- [febf70cb] Add SearchFlag HostNetworkSystem helper +- [cb41663b] Add HostSystem ConfigManager getter +- [6f482eb1] Add HostConfigManager wrapper +- [851cb8d3] Add HostNetworkSystem wrapper +- [8bb8b613] Implement flag.Value interface in NetworkFlag +- [41ebd843] Change destination path for import.vmdk command +- [a6e0f1d4] Don't create VM if vmx already exists +- [b48f0080] Check that DiskFlag.Disk exists +- [8fcafba3] Use DatastoreFlag.Stat method in vmdk.PrepareDestination +- [29daec38] Add DatastoreFlag Stat method +- [29ca9c4a] Use aggregate progess in lease updater +- [de422b52] Enable debug logging with environment variable +- [48690f77] Add script that summarizes debug trace information +- [c515f6e1] Add guest.rm cli command +- [ade53d1e] Remove recursive arg from DeleteFileInGuest +- [63ec87fd] Add guest.start cli command +- [a5dccc14] Add guest.kill cli command +- [8e1abdd4] Add guest.mktemp cli command +- [8d287c3d] Add guest.ls cli command +- [79a67b2d] Fix a few tabwriter outputs Stderr -> Stdout +- [6dc9803f] Remove TODO +- [48a55bbd] Add guest.ps cli command +- [bed7c508] vm arg is required for guest ops +- [fc387eb6] Add example/project links +- [6e75fbf6] Add example: Create and configure a vCenter VM +- [068cc973] Add vm.disk.add command +- [ae42925a] ImportVApp host argument is optional +- [a959e782] Use OutputFlag.Log for ovf warnings +- [db30f1d4] Stream uploads directly from the .ova file +- [b0809106] Add import.Archive interface +- [1faa4e8b] Add Client.Upload method +- [47fe7028] Split datastore.import into multiple commands +- [66a468e2] Rename datastore.delete -> datastore.rm +- [3afcdf5d] Register commands with explicit name +- [07a12472] Load fewer properties where possible +- [3f2d9e5e] Cache rich type info for managed objects +- [be3b5ab1] Install go vet for travis +- [bcf792a0] Add go vet to travis script +- [6be65b35] Rename OutputWrite.WriteTo method to Write +- [b2c603f2] go vet: format related warnings +- [7403b749] go vet: composite literal uses unkeyed fields +- [98ac1aaf] Add NewFolder func +- [eea431c8] Change NewDatastore signature +- [7dbc2b25] Add NewResourcePool func +- [8467fbfd] Support importing VMDKs into ESXi machines +- [8a501f08] Be specific about channel direction +- [abeb8e83] Add DeleteVirtualDisk function +- [11d67d27] Add datastore.import support for .ova files +- [c29ff5c0] Improve about command output +- [bdeb77fd] Add progress for ovf datastore.import +- [4810135c] Ignore PowerOff error in vm.destroy command +- [48c2bbd3] Stop Ticker in ProgressLogger +- [8dfa7db3] Include Client.URL's port in ParseURL +- [c2330cf6] Add progress aggregator for govc +- [d7274985] Use virtual machine flag for vnc command +- [85649cd8] Remove vim25/tasks pkg +- [8f1a2803] Return task objects for every task function +- [df9af568] Add test for progress reader +- [1ddaf841] progessReader passthrough is progress channel is nil +- [9544be13] Add travis ci config +- [bad48a77] Use time.Equal when comparing time.Time +- [e4aeadc2] Upload progress for datastore.import +- [295b4597] Move computation of progress percentage and detail +- [c72543ac] Remove trailing _ from command name +- [2d96f8a5] Add progress report to datastore.{upload,download} +- [ae8509c1] Add functions to about command +- [583a4aca] Merge branch 'readme' +- [2b03454b] Add ovf support to datastore.import +- [fcdfafd6] Add options param to Client.UploadFile +- [0f218092] Move ParseURL helper to Client +- [9f9996e2] Published -> available +- [378e32b9] Fix +- [dae1e4e5] Use WaitForProperties in VirtualMachine.WaitForIP +- [a0335bac] Initial govc readme +- [65050902] Initial govmomi readme +- [231996ff] Add custom HttpNfcLease helpers +- [3293be25] Add Client.WaitForProperties method +- [a28b4fc0] Add generated HttpNfcLease wrapper +- [b610aa5c] Add ResourcePool.ImportVApp wrapper +- [6f9f316f] Add OvfManager getter +- [4ab1b230] Add generated OvfManager wrapper +- [a3e28532] Use virtual machine flag for guest ops +- [8044501f] Configure parent disk on create +- [1786687d] Generate mapping for interface type names +- [f3fa15c1] Use interface type name if type attr is missing +- [27cda4d6] Ignore EEXIST on mkdir in guest +- [c4517301] Use search flag from host system flag +- [9f9b0c9d] Initialize SearchFlag from Register hook +- [02108dd4] Call user function before recursing (govc/cli) +- [73b14a66] Don't overwrite fields (govc/cli) +- [0a5da729] Prefix search flags with entity name +- [cc6aa166] Isset -> IsSet +- [af8adde5] Consistently name pointer receiver 'flag' +- [5cd9a61e] Rename environment variables GOVMOMI -> GOVC +- [45eca426] Use list flag to find host system +- [15fe3728] Use list flag to find resource pool +- [1938ff93] List resource pool in compute resource +- [051ba306] Use list flag to find network +- [4015bec1] Create a VM with a read only parent disk +- [9e98ef07] Upload disk to import to directory +- [72fa245c] Split import into upload and import steps +- [d46b4e51] Add datastore.import command +- [2ba133de] Move datastore path helper to datastore struct +- [ba92fed2] Capture request and response bodies in debug mode +- [2660649a] Add datastore.ls cli command +- [2c8b9fd5] Add Datastore.Browser method +- [8e6805f5] Add HostDatastoreBrowser wrapper +- [6aef2e27] Change generated Base interfaces to a Get method +- [cb0c5763] Add datastore.cp cli command +- [d7cc920a] Add datastore.mv cli command +- [3601ab3b] Add Copy, Move FileManager methods +- [8c62e27e] Datastore commands take paths as regular arguments +- [a740c827] Use list flag to find datastore +- [b7d4b208] Add guest.getenv command +- [e72b79f9] Add guest.chmod command +- [5bd30d15] Use FileAttr flag in guest.upload +- [8c889f03] Add guest FileAttr flag +- [22f854ef] Fix guest RewriteURL method +- [69af5618] Retrieve object ancestors if listing a relative path +- [882faef4] Import vm/guest commands +- [a8fdd5ab] Add guest.upload command +- [93815beb] Add guest.download command +- [108f118d] Add guest.rmdir command +- [77c1f59d] Add guest.mkdir command +- [98283e1a] Common flags and helpers for guest command +- [37065ae1] Add cli flag for guest authentication +- [fc5eb7a7] More GuestFileManager wrappers +- [8611b851] Rename cli datastore upload/download receivers +- [2a058397] Move {Upload,Download}File methods to soap.Client +- [75dfb253] Use list flag to find datacenter +- [b0557434] Add GuestOperationManager wrapper +- [9fb9b66e] Load datacenter name for datastore URL +- [011790a6] Fix DatastoreFlag lookup +- [b7c12086] Add vm.ip command +- [17b0879d] Report progress from vm.power command +- [0a10a798] Avoid panic if ClientFlag url is not set +- [33c26af2] Long/short output for ls command +- [0c97323b] Make traversal of leaf nodes in list code configurable +- [ad0e3778] Add soap.Client.URL method +- [f3289833] Destroy multiple VMs +- [90d80fb3] Power on/off multiple VMs +- [97c2034b] Rename c -> cmd, client -> c +- [8ea428a4] Initialize vm commands with search type +- [1e175eab] Change xml.Decoder.AddType to TypeFunc +- [754da687] Change xml.Decoder.AddType to TypeFunc +- [8cbebfcb] Use list flag from search flag +- [43950349] Use list flag from vm.info cli command +- [0c3080c0] List relative to configurable object +- [c8438410] Extract list functionality as flag +- [ad7bac7a] Support vm.create with -disk .iso +- [189a2231] Add Isset function to search flag +- [bd38dd9b] Add vm.destroy cli command +- [24da8d1c] Add VirtualMachine.Destroy method +- [79466361] Include client counter in debug file prefix +- [11ac68f1] Check if session is valid before returning it +- [685f9554] Return fault from missing set if applicable +- [44575370] Method fault is a base class +- [f1258736] Optionally power on vm after creation +- [dd38436e] Function to map strings to types +- [9a0dde0a] Return VirtualMachine from CreateVM +- [29c8d2ee] Return result from Client.waitForTask +- [a368944d] Move error wrapper to soap package +- [bb62b6a6] Fix client_test compile +- [e0ce3a86] DatastoreFlag refactoring +- [4cd1e77f] Check for DatastorePath required flag +- [79887bf3] Rename DatastorePath to DatastorePathFlag +- [03f2520e] Persist session to disk +- [3a9169e2] Unembed soap.Client from govmomi.Client +- [b510dc18] Implement vm.create cli command +- [06d2e159] Add cli Disk flag +- [b0ce5181] Add cli Network flag +- [8736db1c] Add cli VmFolder flag +- [05a5e45c] Add Folder.CreateVM method +- [4d5eb080] Add VirtualDiskManager wrapper +- [6b4744ac] Move waitForTask method to Client type +- [7e4d047d] Remove embedded ClientFlag +- [a16bada5] Store debug logs on disk +- [e1d7c5b0] Only care about guest.ipAddress property for -waitip +- [647bd102] Use cli flag types for host, pool and datastore +- [14d27b9f] Add cli HostSystemFlag +- [920a5c8a] Add cli ResourcePoolFlag +- [0f76226c] Cache Datastore lookup +- [7bb22ee0] Add govmomi.ResourcePool type +- [6ffac6fc] Wait for the guest to get an IP address +- [2c361e75] Import datastore command package +- [5a68e03c] Add datastore.download command +- [135eb434] Add datastore.upload command +- [02f40085] Add datastore.delete command +- [a25d7233] Add datastore.mkdir command +- [d1f9dad7] Add cli DatastorePathFlag +- [27789049] Add cli DatastoreFlag +- [ea66997e] Add Datastore URL, Upload/Download File methods +- [3c630d4d] Add FileManager wrapper +- [68ca1c21] Unembed ServiceContent in govmomi.Client +- [57dd4153] Enable/disable VNC from govc +- [002cb1dc] Rename field Ref -> Self +- [5a3968ad] Add generic list command +- [31664dcf] Assign reference to self in managed objects +- [99809e14] Include reference to self in managed objects +- [96b65720] Rely on response to determine managed object type +- [dcfd55a6] Include type registry for managed objects +- [46c8fce8] Load complete object for json output +- [ceb3cfa2] Use search flag from power command +- [1e19e548] Add vm.info, host.info commands +- [979d8c48] Split govc/vm/command.go +- [24ce0371] Add output flag +- [32693cf3] Initial stab at listing VMs +- [59734757] Add datacenter flag +- [382bf2bc] More verbosity +- [e9a6152d] Allow embedding of flag types +- [2d2386dc] Move client flag to flags pkg +- [c2f5e99b] Nesting of flags through reflection +- [6d6f9baa] Add SearchIndex wrapper +- [4e06b8ae] govc cli skeleton +- [444617bb] Add power on/off and reset functions to VirtualMachine +- [a1377afa] Add compute resource struct +- [b6aceec1] Add virtual machine struct +- [415f4cd9] Add network struct +- [a7b60eb8] Add datastore struct +- [18ec5f35] Function to retrieve datacenter folders +- [cebbf289] Retrieve only childEntity property for folder +- [c7b42438] Add folder and datacenter types +- [00dce928] Allow custom request for mo.RetrieveProperties +- [1ac7f6df] Embed ServiceContent type in govmomi.Client +- [887b482e] Use cookiejar in soap client +- [3b674be4] Add basic client structure +- [79f0006e] Don't use pointer for enum (string) fields +- [29b2981c] Move generated enum types to their own file +- [5a0e65e5] Import scripts used for code generation +- [71c53d0e] Initial import +- [6081afb9] Add Apache license +- [ff8c717d] Import modifications to xml package +- [57091273] Import Go LICENSE file +- [d5645253] Import encoding/xml from Go 1.3.1 diff --git a/vendor/github.com/vmware/govmomi/CONTRIBUTING.md b/vendor/github.com/vmware/govmomi/CONTRIBUTING.md index f6645cbf4f1..c6d69e54675 100644 --- a/vendor/github.com/vmware/govmomi/CONTRIBUTING.md +++ b/vendor/github.com/vmware/govmomi/CONTRIBUTING.md @@ -1,101 +1,197 @@ -# Contributing to govmomi +# Contributing to `govmomi` ## Getting started First, fork the repository on GitHub to your personal account. -Note that _GOPATH_ can be any directory, the example below uses _$HOME/govmomi_. -Change _$USER_ below to your github username if they are not the same. +Change `$USER` in the examples below to your Github username if they are not the +same. -``` shell -export GOPATH=$HOME/govmomi -go get github.com/vmware/govmomi -cd $GOPATH/src/github.com/vmware/govmomi -git config push.default nothing # anything to avoid pushing to vmware/govmomi by default +```bash +git clone https://github.com/vmware/govmomi.git && cd govmomi + +# prevent accidentally pushing to vmware/govmomi +git config push.default nothing git remote rename origin vmware + +# add your fork git remote add $USER git@github.com:$USER/govmomi.git -git fetch $USER + +git fetch -av ``` -## Installing from source - -Compile the govmomi libraries and install govc using: - -``` shell -go install -v github.com/vmware/govmomi/govc -``` - -Note that **govc/build.sh** is only used for building release binaries. - -## Contribution flow +## Contribution Flow This is a rough outline of what a contributor's workflow looks like: +- Create an issue describing the feature/fix - Create a topic branch from where you want to base your work. - Make commits of logical units. - Make sure your commit messages are in the proper format (see below). -- Update CHANGELOG.md and/or govc/CHANGELOG.md when appropriate. - Push your changes to a topic branch in your fork of the repository. -- Submit a pull request to vmware/govmomi. +- Submit a pull request to `vmware/govmomi`. -Example: +See [below](#format-of-the-commit-message) for details on commit best practices +and **supported prefixes**, e.g. `govc: `. -``` shell -git checkout -b my-new-feature vmware/master -git commit -a -git push $USER my-new-feature +> **Note:** If you are new to Git(hub) check out [Git rebase, squash...oh +> my!](https://www.mgasch.com/2021/05/git-basics/) for more details on how to +> successfully contribute to an open source project. + +### Example 1 - Fix a Bug in `govmomi` + +```bash +git checkout -b issue- vmware/master +git add +git commit -m "fix: ..." -m "Closes: #" +git push $USER issue- ``` -### Stay in sync with upstream +### Example 2 - Add a new (non-breaking) API to `govmomi` -When your branch gets out of sync with the vmware/master branch, use the following to update: +```bash +git checkout -b issue- vmware/master +git add +git commit -m "Add API ..." -m "Closes: #" +git push $USER issue- +``` -``` shell -git checkout my-new-feature +### Example 3 - Add a Feature to `govc` + +```bash +git checkout -b issue- vmware/master +git add +git commit -m "govc: Add feature ..." -m "Closes: #" +git push $USER issue- +``` +**Note**: +To register the new `govc` command package, add a blank `_` import to `govmomi/govc/main.go`. + +### Example 4 - Fix a Bug in `vcsim` + +```bash +git checkout -b issue- vmware/master +git add +git commit -m "vcsim: Fix ..." -m "Closes: #" +git push $USER issue- +``` + +### Example 5 - Document Breaking (API) Changes + +Breaking changes, e.g. to the `govmomi` APIs, are highlighted in the `CHANGELOG` +and release notes when the keyword `BREAKING:` is used in the commit message +body. + +The text after `BREAKING:` is used in the corresponding highlighted section. +Thus these details should be stated at the body of the commit message. +Multi-line strings are supported. + +```bash +git checkout -b issue- vmware/master +git add +cat << EOF | git commit -F - +Add ctx to funcXYZ + +This commit introduces context.Context to function XYZ +Closes: #1234 + +BREAKING: Add ctx to funcXYZ() +EOF + +git push $USER issue- +``` + +### Stay in sync with Upstream + +When your branch gets out of sync with the vmware/master branch, use the +following to update (rebase): + +```bash +git checkout issue- git fetch -a git rebase vmware/master -git push --force-with-lease $USER my-new-feature +git push --force-with-lease $USER issue- ``` -### Updating pull requests +### Updating Pull Requests -If your PR fails to pass CI or needs changes based on code review, you'll most likely want to squash these changes into -existing commits. +If your PR fails to pass CI or needs changes based on code review, it's ok to +add more commits stating the changes made, e.g. "Address review comments". This +is to assist the reviewer(s) to easily detect and review the recent changes. -If your pull request contains a single commit or your changes are related to the most recent commit, you can simply -amend the commit. +In case of small PRs, it's ok to squash and force-push (see further below) +directly instead. -``` shell +```bash +# incorporate review feedback git add . -git commit --amend -git push --force-with-lease $USER my-new-feature -``` -If you need to squash changes into an earlier commit, you can use: - -``` shell -git add . +# create a fixup commit which will be merged into your (original) git commit --fixup -git rebase -i --autosquash vmware/master -git push --force-with-lease $USER my-new-feature +git push $USER issue- ``` -Be sure to add a comment to the PR indicating your new changes are ready to review, as github does not generate a -notification when you git push. +Be sure to add a comment to the PR indicating your new changes are ready to +review, as Github does not generate a notification when you git push. -### Code style +Once the review is complete, squash and push your final commit(s): -The coding style suggested by the Golang community is used in govmomi. See the +```bash +# squash all commits into one +# --autosquash will automatically detect and merge fixup commits +git rebase -i --autosquash vmware/master +git push --force-with-lease $USER issue- +``` + +### Code Style + +The coding style suggested by the Go community is used in `govmomi`. See the [style doc](https://github.com/golang/go/wiki/CodeReviewComments) for details. -Try to limit column width to 120 characters for both code and markdown documents such as this one. +Try to limit column width to 120 characters for both code and markdown documents +such as this one. ### Format of the Commit Message -We follow the conventions on [How to Write a Git Commit Message](http://chris.beams.io/posts/git-commit/). +We follow the conventions described in [How to Write a Git Commit +Message](http://chris.beams.io/posts/git-commit/). -Be sure to include any related GitHub issue references in the commit message. +Be sure to include any related GitHub issue references in the commit message, +e.g. `Closes: #`. + +The [`CHANGELOG.md`](./CHANGELOG.md) and release page uses **commit message +prefixes** for grouping and highlighting. A commit message that +starts with `[prefix:] ` will place this commit under the respective +section in the `CHANGELOG`. + +The following example creates a commit referencing the `issue: 1234` and puts +the commit message in the `govc` `CHANGELOG` section: + +```bash +git commit -s -m "govc: Add CLI command X" -m "Closes: #1234" +``` + +Currently the following prefixes are used: + +- `api:` - Use for API-related changes +- `govc:` - Use for changes to `govc` CLI +- `vcsim:` - Use for changes to vCenter Simulator +- `chore:` - Use for repository related activities +- `fix:` - Use for bug fixes +- `docs:` - Use for changes to the documentation +- `examples:` - Use for changes to examples + +If your contribution falls into multiple categories, e.g. `api` and `vcsim` it +is recommended to break up your commits using distinct prefixes. + +### Running CI Checks and Tests +You can run both `make check` and `make test` from the top level of the +repository. + +While `make check` will catch formatting and import errors, it will not apply +any fixes. The developer is expected to do that. ## Reporting Bugs and Creating Issues -When opening a new issue, try to roughly follow the commit message format conventions above. +When opening a new issue, try to roughly follow the commit message format +conventions above. diff --git a/vendor/github.com/vmware/govmomi/CONTRIBUTORS b/vendor/github.com/vmware/govmomi/CONTRIBUTORS index 6a421d09912..ef8c56de8b2 100644 --- a/vendor/github.com/vmware/govmomi/CONTRIBUTORS +++ b/vendor/github.com/vmware/govmomi/CONTRIBUTORS @@ -5,104 +5,252 @@ Abhijeet Kasurde abrarshivani +Adam Chalkley +Adam Fowler Adam Shannon +Akanksha Panse +Al Biheiri Alessandro Cortiana +Alex Alex Bozhenko Alex Ellis (VMware) +Aligator <8278538+yet-another-aligator@users.noreply.github.com> Alvaro Miranda Amanda H. L. de Andrade +amanpaha Amit Bathla amit bezalel Andrew Andrew Chin Andrew Kutz +Andrey Klimentyev Anfernee Yongkun Gui angystardust aniketGslab +Ankit Vaidya +Ankur Huralikoppi +Anna Carrigan +Antony Saba +Ariel Chinn Arran Walker +Artem Anisimov +Arunesh Pandey Aryeh Weinreb +Augy StClair Austin Parker Balu Dontu bastienbc +Ben Corrie +Ben Vickers +Benjamin Davini +Benjamin Peterson +Benjamin Vickers +Bhavya Choudhary Bob Killen Brad Fitzpatrick +Brian Rak +brian57860 Bruce Downs +Bryan Venteicher Cédric Blomart +Cheng Cheng +Chethan Venkatesh +Choudhury Sarada Prasanna Nanda Chris Marchesi Christian Höltje Clint Greenwood +cpiment CuiHaozhi +Dan Ilan +Dan Norris +Daniel Frederick Crisman +Daniel Mueller Danny Lockard +Dave Gress +Dave Smith-Uchida Dave Tucker -Davide Agnello +David Gress David Stark +Davide Agnello Davinder Kumar +Defa +demarey +dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Deric Crago +ditsuke +Divyen Patel +Dnyanesh Gate Doug MacEachern +East <60801291+houfangdong@users.noreply.github.com> Eloy Coto +embano1 +Eng Zer Jun +Eric Edens +Eric Graham <16710890+Pheric@users.noreply.github.com> Eric Gray Eric Yutao Erik Hollensbe +Essodjolo KAHANAM Ethan Kaley +Evan Chu Fabio Rapposelli -Faiyaz Ahmed +Faiyaz Ahmed +Federico Pellegatta <12744504+federico-pellegatta@users.noreply.github.com> forkbomber +François Rigault freebsdly Gavin Gray Gavrie Philipson George Hicken Gerrit Renker gthombare +HakanSunay Hasan Mahmood +Haydon Ryan +Heiko Reese Henrik Hodne +hkumar +Hrabur Stoyanov +hui luo +Ian Eyberg Isaac Rodman +Ivan Mikushin Ivan Porto Carrero James King +James Peach Jason Kincl Jeremy Canady jeremy-clerc Jiatong Wang +jingyizPensando João Pereira Jonas Ausevicius Jorge Sevilla +Julien PILLON +Justin J. Novack kayrus +Keenan Brock Kevin George +Knappek +Leslie Wang leslie-qiwa +Lintong Jiang +Liping Xue Louie Jiang +Luther Monson +Madanagopal Arunachalam +makelarisjr <8687447+makelarisjr@users.noreply.github.com> maplain Marc Carmier +Marcus Tan Maria Ntalla Marin Atanasov Nikolov +Mario Trangoni +Mark Dechiaro +Mark Peek +Mark Rexwinkel +martin Matt Clay -Matthew Cosgrove +Matt Moore Matt Moriarity +Matthew Cosgrove +mbhadale +Merlijn Sebrechts Mevan Samaratunga +Michael Gasch <15986659+embano1@users.noreply.github.com> +Michael Gasch Michal Jankowski +Mike Schinkel +Mincho Tonev mingwei Nicolas Lamirault +Nikhil Kathare +Nikhil R Deshpande +Nikolas Grottendieck +Nils Elde +nirbhay +Nobuhiro MIKI +Om Kumar Omar Kohl Parham Alvani +Parveen Chahal +Paul Martin <25058109+rawstorage@users.noreply.github.com> Pierre Gronlier Pieter Noordhuis +pradeepj <50135054+pradeep288@users.noreply.github.com> +Pranshu Jain prydin +rconde01 +rHermes +Rianto Wahyudi +Ricardo Katz +Robin Watkins Rowan Jacobs +Roy Ling +rsikdar runner.mei +Ryan Johnson +S R Ashrith S.Çağlar Onur +Saad Malik +Sam Zhu +samzhu333 <45263849+samzhu333@users.noreply.github.com> +Sandeep Pissay Srinivasa Rao +Scott Holden Sergey Ignatov +serokles +shahra +Shalini Bhaskara +Shaozhen Ding +Shawn Neal +shylasrinivas +sky-joker +smaftoul +smahadik +Sten Feldman +Stepan Mazurov Steve Purcell +Sudhindra Aithal +SUMIT AGRAWAL +Sunny Carter +syuparn Takaaki Furukawa Tamas Eger +Tanay Kothari tanishi Ted Zlatanov +Thad Craft Thibaut Ackermann +Tim McNamara +Tjeu Kayim <15987676+TjeuKayim@users.noreply.github.com> +Toomas Pelberg Trevor Dawe +tshihad Uwe Bessle Vadim Egorov Vikram Krishnamurthy +volanja Volodymyr Bobyr +Waldek Maleska +William Lam Witold Krecicki +xing-yang +xinyanw409 Yang Yang +yangxi +Yann Hodique +Yash Nitin Desai +Yassine TIJANI +Yi Jiang +yiyingy +ykakarap +Yogesh Sobale <6104071+ysobale@users.noreply.github.com> +Yue Yin +Yun Zhou Yuya Kusakabe -Zacharias Taubert +Zach G Zach Tucker +Zacharias Taubert Zee Yang +zyuxin +Кузаков Евгений diff --git a/vendor/github.com/vmware/govmomi/Dockerfile b/vendor/github.com/vmware/govmomi/Dockerfile deleted file mode 100644 index 4f84fadaafb..00000000000 --- a/vendor/github.com/vmware/govmomi/Dockerfile +++ /dev/null @@ -1,4 +0,0 @@ -FROM scratch -LABEL maintainer="fabio@vmware.com" -COPY govc / -ENTRYPOINT [ "/govc" ] \ No newline at end of file diff --git a/vendor/github.com/vmware/govmomi/Dockerfile.govc b/vendor/github.com/vmware/govmomi/Dockerfile.govc new file mode 100644 index 00000000000..e7d6766b01e --- /dev/null +++ b/vendor/github.com/vmware/govmomi/Dockerfile.govc @@ -0,0 +1,45 @@ +# Create a builder container +# golang:1.18.0-buster amd64 +FROM golang@sha256:7d39537344486528f8cdb3bd8adb98ab7f0f4236044b6944fed8631da35a4ce5 AS build +WORKDIR /go/src/app + +# Create appuser to isolate potential vulnerabilities +# See https://stackoverflow.com/a/55757473/12429735 +ENV USER=appuser +ENV UID=10001 +RUN adduser \ + --disabled-password \ + --gecos "" \ + --shell "/sbin/nologin" \ + --no-create-home \ + --uid "${UID}" \ + "${USER}" + +# Create a new tmp directory so no bad actors can manipulate it +RUN mkdir /temporary-tmp-directory && chmod 777 /temporary-tmp-directory + +############################################################################### +# Final stage +FROM scratch + +# Allow container to use latest TLS certificates +COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ + +# Copy over appuser to run as non-root +COPY --from=build /etc/passwd /etc/passwd +COPY --from=build /etc/group /etc/group + +# Copy over the /tmp directory for golang/os.TmpDir +COPY --chown=appuser --from=build /temporary-tmp-directory /tmp + +# Copy application from external build +COPY govc /govc + +# Run all commands as non-root +USER appuser:appuser + +# session cache, etc +ENV GOVMOMI_HOME=/tmp + +# Set CMD to application with container defaults +CMD ["/govc"] diff --git a/vendor/github.com/vmware/govmomi/Dockerfile.vcsim b/vendor/github.com/vmware/govmomi/Dockerfile.vcsim new file mode 100644 index 00000000000..141de0ff2e0 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/Dockerfile.vcsim @@ -0,0 +1,47 @@ +# Create a builder container +# golang:1.18.0-buster amd64 +FROM golang@sha256:7d39537344486528f8cdb3bd8adb98ab7f0f4236044b6944fed8631da35a4ce5 AS build +WORKDIR /go/src/app + +# Create appuser to isolate potential vulnerabilities +# See https://stackoverflow.com/a/55757473/12429735 +ENV USER=appuser +ENV UID=10001 +RUN adduser \ + --disabled-password \ + --gecos "" \ + --home "/nonexistent" \ + --shell "/sbin/nologin" \ + --no-create-home \ + --uid "${UID}" \ + "${USER}" + +# Create a new tmp directory so no bad actors can manipulate it +RUN mkdir /temporary-tmp-directory && chmod 777 /temporary-tmp-directory + +############################################################################### +# Final stage +FROM scratch + +# Run all commands as non-root +USER appuser:appuser + +# Allow container to use latest TLS certificates +COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ + +# Copy over appuser to run as non-root +COPY --from=build /etc/passwd /etc/passwd +COPY --from=build /etc/group /etc/group + +# Copy over the /tmp directory for golang/os.TmpDir +COPY --chown=appuser --from=build /temporary-tmp-directory /tmp + +# Expose application port +EXPOSE 8989 + +# Copy application from external build +COPY vcsim /vcsim + +# Set entrypoint to application with container defaults +ENTRYPOINT [ "/vcsim" ] +CMD ["-l", "0.0.0.0:8989"] diff --git a/vendor/github.com/vmware/govmomi/Gopkg.lock b/vendor/github.com/vmware/govmomi/Gopkg.lock deleted file mode 100644 index f45057fb220..00000000000 --- a/vendor/github.com/vmware/govmomi/Gopkg.lock +++ /dev/null @@ -1,60 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - branch = "improvements" - digest = "1:b183578c34fabccaf65f1a57d2efeec2086abdce1446978d69ab3a0016cb750c" - name = "github.com/davecgh/go-xdr" - packages = ["xdr2"] - pruneopts = "NUT" - revision = "4930550ba2e22f87187498acfd78348b15f4e7a8" - source = "https://github.com/rasky/go-xdr" - -[[projects]] - digest = "1:1ab18cf8c2084968d6dca0dd46fbda9efba08664ecd7957b63c7ca57bb2455df" - name = "github.com/google/uuid" - packages = ["."] - pruneopts = "NUT" - revision = "6a5e28554805e78ea6141142aba763936c4761c0" - -[[projects]] - branch = "govmomi" - digest = "1:f49ed6cb2129e9a3ce9dde5037cb243b5849c0ec0c7973b9d1e987872d8b8cc6" - name = "github.com/kr/pretty" - packages = ["."] - pruneopts = "NUT" - revision = "2ee9d7453c02ef7fa518a83ae23644eb8872186a" - source = "https://github.com/dougm/pretty" - -[[projects]] - branch = "master" - digest = "1:c3a7836b5904db0f8b609595b619916a6831cb35b8b714aec39f96d00c6155d8" - name = "github.com/kr/text" - packages = ["."] - pruneopts = "NUT" - revision = "7cafcd837844e784b526369c9bce262804aebc60" - -[[projects]] - branch = "master" - digest = "1:4bea31865971675c482ed875caeabe7d2182dcb47d52900b7da5236d66dc9970" - name = "github.com/vmware/vmw-guestinfo" - packages = [ - "bdoor", - "message", - "vmcheck", - ] - pruneopts = "NUT" - revision = "25eff159a728be87e103a0b8045e08273f4dbec4" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = [ - "github.com/davecgh/go-xdr/xdr2", - "github.com/google/uuid", - "github.com/kr/pretty", - "github.com/vmware/vmw-guestinfo/message", - "github.com/vmware/vmw-guestinfo/vmcheck", - ] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/vendor/github.com/vmware/govmomi/Gopkg.toml b/vendor/github.com/vmware/govmomi/Gopkg.toml deleted file mode 100644 index 4c4d6765e6f..00000000000 --- a/vendor/github.com/vmware/govmomi/Gopkg.toml +++ /dev/null @@ -1,19 +0,0 @@ -# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md -# for detailed Gopkg.toml documentation. -# -# Refer to https://github.com/toml-lang/toml for detailed TOML docs. - -[prune] - non-go = true - go-tests = true - unused-packages = true - -[[constraint]] - branch = "improvements" - name = "github.com/davecgh/go-xdr" - source = "https://github.com/rasky/go-xdr" - -[[constraint]] - branch = "govmomi" - name = "github.com/kr/pretty" - source = "https://github.com/dougm/pretty" diff --git a/vendor/github.com/vmware/govmomi/Makefile b/vendor/github.com/vmware/govmomi/Makefile index ee17fe586fe..1a89322a324 100644 --- a/vendor/github.com/vmware/govmomi/Makefile +++ b/vendor/github.com/vmware/govmomi/Makefile @@ -1,29 +1,158 @@ -.PHONY: test +# Copyright (c) 2021 VMware, Inc. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 -all: check test +# If you update this file, please follow +# https://www.thapaliya.com/en/writings/well-documented-makefiles/ -check: goimports govet +# Ensure Make is run with bash shell as some syntax below is bash-specific +SHELL := /usr/bin/env bash -goimports: - @echo checking go imports... - @command -v goimports >/dev/null 2>&1 || go get golang.org/x/tools/cmd/goimports - @! goimports -d . 2>&1 | egrep -v '^$$' +# Print the help/usage when make is executed without any other arguments +.DEFAULT_GOAL := help -govet: - @echo checking go vet... - @go tool vet -structtags=false -methods=false $$(find . -mindepth 1 -maxdepth 1 -type d -not -name vendor) -install: +## -------------------------------------- +## Help +## -------------------------------------- + +.PHONY: help +help: ## Display usage + @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make [target] \033[36m\033[0m\n\nTargets:\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 }' $(MAKEFILE_LIST) + + +## -------------------------------------- +## Locations and programs +## -------------------------------------- + +# Directories +BIN_DIR := bin +TOOLS_DIR := hack/tools +TOOLS_BIN_DIR := $(TOOLS_DIR)/bin + +# Tooling binaries +GO ?= $(shell command -v go 2>/dev/null) +GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint + + +## -------------------------------------- +## Prerequisites +## -------------------------------------- + +# Do not proceed unless the go binary is present. +ifeq (,$(strip $(GO))) +$(error The "go" program cannot be found) +endif + + +## -------------------------------------- +## Linting and fixing linter errors +## -------------------------------------- + +.PHONY: lint +lint: ## Run all the lint targets + $(MAKE) lint-go-full + +GOLANGCI_LINT_FLAGS ?= --fast=true +.PHONY: lint-go +lint-go: $(GOLANGCI_LINT) ## Lint codebase + $(GOLANGCI_LINT) run -v $(GOLANGCI_LINT_FLAGS) + +.PHONY: lint-go-full +lint-go-full: GOLANGCI_LINT_FLAGS = --fast=false +lint-go-full: lint-go ## Run slower linters to detect possible issues + +.PHONY: fix +fix: GOLANGCI_LINT_FLAGS = --fast=false --fix +fix: lint-go ## Tries to fix errors reported by lint-go-full target + +.PHONY: check +check: lint-go-full +check: ## Run linters + + +## -------------------------------------- +## Tooling Binaries +## -------------------------------------- + +TOOLING_BINARIES := $(GOLANGCI_LINT) +tools: $(TOOLING_BINARIES) ## Build tooling binaries +.PHONY: $(TOOLING_BINARIES) +$(TOOLING_BINARIES): + cd $(TOOLS_DIR); make $(@F) + + +## -------------------------------------- +## Build / Install +## -------------------------------------- +.PHONY: install +install: ## Install govc and vcsim $(MAKE) -C govc install $(MAKE) -C vcsim install -go-test: - GORACE=history_size=5 go test -timeout 5m -count 1 -race -v $(TEST_OPTS) ./... +## -------------------------------------- +## Generate +## -------------------------------------- + +.PHONY: mod +mod: ## Runs go mod tidy to validate modules + go mod tidy -v + +.PHONY: mod-get +mod-get: ## Downloads and caches the modules + go mod download + +.PHONY: doc +doc: install +doc: ## Generates govc USAGE.md + ./govc/usage.sh > ./govc/USAGE.md + + +## -------------------------------------- +## Tests +## -------------------------------------- + +# Test options +TEST_COUNT ?= 1 +TEST_TIMEOUT ?= 5m +TEST_RACE_HISTORY_SIZE ?= 5 +GORACE ?= history_size=$(TEST_RACE_HISTORY_SIZE) + +ifeq (-count,$(findstring -count,$(TEST_OPTS))) +$(error Use TEST_COUNT to override this option) +endif + +ifeq (-race,$(findstring -race,$(TEST_OPTS))) +$(error The -race flag is enabled by default & cannot be specified in TEST_OPTS) +endif + +ifeq (-timeout,$(findstring -timeout,$(TEST_OPTS))) +$(error Use TEST_TIMEOUT to override this option) +endif + +.PHONY: go-test +go-test: ## Runs go unit tests with race detector enabled + GORACE=$(GORACE) $(GO) test \ + -count $(TEST_COUNT) \ + -race \ + -timeout $(TEST_TIMEOUT) \ + -v $(TEST_OPTS) \ + ./... + +.PHONY: govc-test govc-test: install +govc-test: ## Runs govc bats tests + ./govc/test/images/update.sh (cd govc/test && ./vendor/github.com/sstephenson/bats/libexec/bats -t .) -test: go-test govc-test +.PHONY: govc-test-sso +govc-test-sso: install + ./govc/test/images/update.sh + (cd govc/test && SSO_BATS=1 ./vendor/github.com/sstephenson/bats/libexec/bats -t sso.bats) -doc: install - ./govc/usage.sh > ./govc/USAGE.md +.PHONY: govc-test-sso-assert-cert +govc-test-sso-assert-cert: + SSO_BATS_ASSERT_CERT=1 $(MAKE) govc-test-sso + +.PHONY: test +test: go-test govc-test ## Runs go-test and govc-test diff --git a/vendor/github.com/vmware/govmomi/README.md b/vendor/github.com/vmware/govmomi/README.md index 1c31bbdda40..60a18d6e127 100644 --- a/vendor/github.com/vmware/govmomi/README.md +++ b/vendor/github.com/vmware/govmomi/README.md @@ -1,94 +1,131 @@ -[![Build Status](https://travis-ci.org/vmware/govmomi.png?branch=master)](https://travis-ci.org/vmware/govmomi) -[![Go Report Card](https://goreportcard.com/badge/github.com/vmware/govmomi)](https://goreportcard.com/report/github.com/vmware/govmomi) + + +[![Build](https://github.com/vmware/govmomi/actions/workflows/govmomi-build.yaml/badge.svg)][ci-build] +[![Tests](https://github.com/vmware/govmomi/actions/workflows/govmomi-go-tests.yaml/badge.svg)][ci-tests] +[![Go Report Card](https://goreportcard.com/badge/github.com/vmware/govmomi)][go-report-card] +[![Latest Release](https://img.shields.io/github/release/vmware/govmomi.svg?logo=github&style=flat-square)][latest-release] +[![Go Reference](https://pkg.go.dev/badge/github.com/vmware/govmomi.svg)][go-reference] +[![go.mod Go version](https://img.shields.io/github/go-mod/go-version/vmware/govmomi)][go-version] # govmomi -A Go library for interacting with VMware vSphere APIs (ESXi and/or vCenter). +A Go library for interacting with VMware vSphere APIs (ESXi and/or vCenter Server). In addition to the vSphere API client, this repository includes: -* [govc](./govc) - vSphere CLI - -* [vcsim](./vcsim) - vSphere API mock framework - -* [toolbox](./toolbox) - VM guest tools framework +* [govc][govc] - vSphere CLI +* [vcsim][vcsim] - vSphere API mock framework +* [toolbox][toolbox] - VM guest tools framework ## Compatibility -This library is built for and tested against ESXi and vCenter 6.0, 6.5 and 6.7. +This library supports vCenter Server and ESXi versions following the [VMware Product Lifecycle Matrix][reference-lifecycle]. -It may work with versions 5.5 and 5.1, but neither are officially supported. +Product versions that are end of support may work, but are not officially supported. ## Documentation -The APIs exposed by this library very closely follow the API described in the [VMware vSphere API Reference Documentation][apiref]. -Refer to this document to become familiar with the upstream API. +The APIs exposed by this library closely follow the API described in the [VMware vSphere API Reference Documentation][reference-api]. Refer to the documentation to become familiar with the upstream API. -The code in the `govmomi` package is a wrapper for the code that is generated from the vSphere API description. -It primarily provides convenience functions for working with the vSphere API. -See [godoc.org][godoc] for documentation. - -[apiref]:http://pubs.vmware.com/vsphere-6-5/index.jsp#com.vmware.wssdk.apiref.doc/right-pane.html -[godoc]:http://godoc.org/github.com/vmware/govmomi +The code in the `govmomi` package is a wrapper for the code that is generated from the vSphere API description. It primarily provides convenience functions for working with the vSphere API. See [godoc.org][reference-godoc] for documentation. ## Installation -```sh +### govmomi (Package) + +```bash go get -u github.com/vmware/govmomi ``` +### Binaries and Docker Images for `govc` and `vcsim` + +Installation instructions, released binaries, and Docker images are documented in the respective README files of [`govc`][govc] and [`vcsim`][vcsim]. + ## Discussion -Contributors and users are encouraged to collaborate using GitHub issues and/or -[Slack](https://vmwarecode.slack.com/messages/govmomi). -Access to Slack requires a [VMware {code} membership](https://code.vmware.com/join/). +The project encourages the community to collaborate using GitHub [issues][govmomi-github-issues], GitHub [discussions][govmomi-github-discussions], and [Slack][slack-channel]. + +> **Note** +> Access to Slack requires a free [VMware {code}][slack-join] developer program membership. ## Status -Changes to the API are subject to [semantic versioning](http://semver.org). +Changes to the API are subject to [semantic versioning][reference-semver]. -Refer to the [CHANGELOG](CHANGELOG.md) for version to version changes. +Refer to the [CHANGELOG][govmomi-changelog] for version to version changes. -## Projects using govmomi +## Notable Projects Using govmomi -* [Docker Machine](https://github.com/docker/machine/tree/master/drivers/vmwarevsphere) +* [collectd-vsphere][project-travisci-collectd-vsphere] +* [Docker LinuxKit][project-docker-linuxKit] +* [Elastic Agent VMware vSphere integration][project-elastic-agent] +* [Gru][project-gru] +* [Juju][project-juju] +* [Jupiter Brain][project-travisci-jupiter-brain] +* [Kubernetes vSphere Cloud Provider][project-k8s-cloud-provider] +* [Kubernetes Cluster API][project-k8s-cluster-api] +* [OPS][project-nanovms-ops] +* [Packer Plugin for VMware vSphere][project-hashicorp-packer-plugin-vsphere] +* [Rancher][project-rancher] +* [Terraform Provider for VMware vSphere][project-hashicorp-terraform-provider-vsphere] +* [Telegraf][project-influxdata-telegraf] +* [VMware Event Broker Appliance][project-vmware-veba] +* [VMware vSphere Integrated Containers Engine][project-vmware-vic] +* [VMware vSphere 7.0][project-vmware-vsphere] -* [Docker InfraKit](https://github.com/docker/infrakit/tree/master/pkg/provider/vsphere) +## Related Projects -* [Docker LinuxKit](https://github.com/linuxkit/linuxkit/tree/master/src/cmd/linuxkit) - -* [Kubernetes](https://github.com/kubernetes/kubernetes/tree/master/pkg/cloudprovider/providers/vsphere) - -* [Kubernetes Cloud Provider](https://github.com/kubernetes/cloud-provider-vsphere) - -* [Kubernetes Cluster API](https://github.com/kubernetes-sigs/cluster-api-provider-vsphere) - -* [Kubernetes kops](https://github.com/kubernetes/kops/tree/master/upup/pkg/fi/cloudup/vsphere) - -* [Terraform](https://github.com/terraform-providers/terraform-provider-vsphere) - -* [Packer](https://github.com/jetbrains-infra/packer-builder-vsphere) - -* [VMware VIC Engine](https://github.com/vmware/vic) - -* [Travis CI](https://github.com/travis-ci/jupiter-brain) - -* [collectd-vsphere](https://github.com/travis-ci/collectd-vsphere) - -* [Gru](https://github.com/dnaeon/gru) - -* [Libretto](https://github.com/apcera/libretto/tree/master/virtualmachine/vsphere) - -* [Telegraf](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/vsphere) - -* [Open Storage](https://github.com/libopenstorage/openstorage/tree/master/pkg/storageops/vsphere) - -## Related projects - -* [rbvmomi](https://github.com/vmware/rbvmomi) - -* [pyvmomi](https://github.com/vmware/pyvmomi) +* [go-vmware-nsxt][reference-go-vmware-nsxt] +* [pyvmomi][reference-pyvmomi] +* [rbvmomi][reference-rbvmomi] ## License -govmomi is available under the [Apache 2 license](LICENSE.txt). +govmomi is available under the [Apache 2 License][govmomi-license]. + +## Name + +Pronounced: _go·​v·​mom·​ie_ + +Follows pyvmomi and rbvmomi: language prefix + the vSphere acronym "VM Object Management Infrastructure". + +[//]: Links + +[ci-build]: https://github.com/vmware/govmomi/actions/workflows/govmomi-build.yaml +[ci-tests]: https://github.com/vmware/govmomi/actions/workflows/govmomi-go-tests.yaml +[latest-release]: https://github.com/vmware/govmomi/releases/latest +[govc]: govc/README.md +[govmomi-github-issues]: https://github.com/vmware/govmomi/issues +[govmomi-github-discussions]: https://github.com/vmware/govmomi/discussions +[govmomi-changelog]: CHANGELOG.md +[govmomi-license]: LICENSE.txt +[go-reference]: https://pkg.go.dev/github.com/vmware/govmomi +[go-report-card]: https://goreportcard.com/report/github.com/vmware/govmomi +[go-version]: https://github.com/vmware/govmomi +[project-docker-linuxKit]: https://github.com/linuxkit/linuxkit/tree/master/src/cmd/linuxkit +[project-elastic-agent]: https://github.com/elastic/integrations/tree/main/packages/vsphere +[project-gru]: https://github.com/dnaeon/gru +[project-hashicorp-packer-plugin-vsphere]: https://github.com/hashicorp/packer-plugin-vsphere +[project-hashicorp-terraform-provider-vsphere]: https://github.com/hashicorp/terraform-provider-vsphere +[project-influxdata-telegraf]: https://github.com/influxdata/telegraf/tree/master/plugins/inputs/vsphere +[project-juju]: https://github.com/juju/juju +[project-k8s-cloud-provider]: https://github.com/kubernetes/cloud-provider-vsphere +[project-k8s-cluster-api]: https://github.com/kubernetes-sigs/cluster-api-provider-vsphere +[project-nanovms-ops]: https://github.com/nanovms/ops +[project-rancher]: https://github.com/rancher/rancher/blob/master/pkg/api/norman/customization/vsphere/listers.go +[project-travisci-collectd-vsphere]: https://github.com/travis-ci/collectd-vsphere +[project-travisci-jupiter-brain]: https://github.com/travis-ci/jupiter-brain +[project-vmware-veba]: https://github.com/vmware-samples/vcenter-event-broker-appliance/tree/development/vmware-event-router +[project-vmware-vic]: https://github.com/vmware/vic +[project-vmware-vsphere]: https://docs.vmware.com/en/VMware-vSphere/7.0/rn/vsphere-esxi-vcenter-server-7-vsphere-with-kubernetes-release-notes.html +[reference-api]: https://developer.vmware.com/apis/968/vsphere +[reference-godoc]: http://godoc.org/github.com/vmware/govmomi +[reference-go-vmware-nsxt]: https://github.com/vmware/go-vmware-nsxt +[reference-lifecycle]: https://lifecycle.vmware.com +[reference-pyvmomi]: https://github.com/vmware/pyvmomi +[reference-rbvmomi]: https://github.com/vmware/rbvmomi +[reference-semver]: http://semver.org +[slack-join]: https://developer.vmware.com/join/ +[slack-channel]: https://vmwarecode.slack.com/messages/govmomi +[toolbox]: toolbox/README.md +[vcsim]: vcsim/README.md diff --git a/vendor/github.com/vmware/govmomi/RELEASE.md b/vendor/github.com/vmware/govmomi/RELEASE.md new file mode 100644 index 00000000000..1a12c0640bd --- /dev/null +++ b/vendor/github.com/vmware/govmomi/RELEASE.md @@ -0,0 +1,225 @@ +# How to create a `govmomi` Release on Github + +> **Note** +> +> The steps outlined in this document can only be performed by maintainers or +> administrators of this project. + +The release automation is based on Github +[Actions](https://github.com/features/actions) and has been improved over time +to simplify the experience for creating `govmomi` releases. + +The Github Actions release [workflow](.github/workflows/govmomi-release.yaml) +uses [`goreleaser`](http://goreleaser.com/) and automatically creates/pushes: + +- Release artifacts for `govc` and `vcsim` to the + [release](https://github.com/vmware/govmomi/releases) page, including + `LICENSE.txt`, `README` and `CHANGELOG` +- Docker images for `vmware/govc` and `vmware/vcsim` to Docker Hub +- Source code + +Starting with release tag `v0.29.0`, releases are not tagged on the `master` +branch anymore but a dedicated release branch, for example `release-0.29`. This +process has already been followed for patch releases and back-ports. + +> **Warning** +> +> If you create a release after the `v0.29.0` tag, start +> [here](#creating-a-release-after-v0290). To create a release with an older +> tag, e.g. cherrypick or back-port, continue +> [here](#creating-a-release-before-v0290). + +## Creating a release after Version `v0.29.0` + +The release process from `v0.29.0` has been further simplified and is done +through the Github UI. The only pre-requirement is creating a release branch, +which can be done through the Github UI or `git` CLI. + +This guide describes the CLI process. + +### Verify `master` branch is up to date with the remote + +```console +git checkout master +git fetch -avp +git diff master origin/master + +# if your local and remote branches diverge run +git pull origin/master +``` + +> **Warning** +> +> These steps assume `origin` to point to the remote +> `https://github.com/vmware/govmomi`, respectively +> `git@github.com:vmware/govmomi`. + +### Create a release branch + +For new releases, create a release branch from the most recent commit in +`master`, e.g. `release-0.30`. + +```console +export RELEASE_BRANCH=release-0.30 +git checkout -b ${RELEASE_BRANCH} +``` + +For maintenance/patch releases on **existing** release branches **after** tag +`v0.29.0` simply checkout the existing release branch and add commits to the +existing release branch. + +### Verify `make docs` and `CONTRIBUTORS` are up to date + +> **Warning** +> +> Run the following commands and commit any changes to the release branch before +> proceeding with the release. + +```console +make doc +./scripts/contributors.sh +if [ -z "$(git status --porcelain)" ]; then + echo "working directory clean: proceed with release" +else + echo "working directory dirty: please commit changes" +fi + +# perform git add && git commit ... in case there were changes +``` + +### Push the release branch + +> **Warning** +> +> Do not create a tag as this will be done by the release automation. + +The final step is pushing the new/updated release branch. + +```console +git push origin ${RELEASE_BRANCH} +``` + +### Create a release in the Github UI + +Open the `govmomi` Github [repository](https://github.com/vmware/govmomi) and +navigate to `Actions -> Workflows -> Release`. + +Click `Run Workflow` which opens a dropdown list. + +Select the new/updated branch, e.g. `release-0.30`, i.e. **not** the `master` +branch. + +Specify a semantic `tag` to associate with the release, e.g. `v0.30.0`. + +> **Warning** +> +> This tag **must not** exist or the release will fail during the validation +> phase. + +By default, a dry-run is performed to rule out most (but not all) errors during +a release. If you do not want to perform a dry-run, e.g. to finally create a +release, deselect the `Verify release workflow ...` checkbox. + +Click `Run Workflow` to kick off the workflow. + +After successful completion and if the newly created `tag` is the **latest** +(semantic version sorted) tag in the repository, a PR is automatically opened +against the `master` branch to update the `CHANGELOG`. Please review and merge +accordingly. + +## Creating a release before Version `v0.29.0` + +The release process before `v0.29.0` differs since it's based on manually +creating and pushing tags. Here, on every new tag matching `v*` pushed to the +repository a Github Action Release Workflow is executed. + +### Verify `master` branch is up to date with the remote + +```console +git checkout master +git fetch -avp +git diff master origin/master + +# if your local and remote branches diverge run +git pull origin/master +``` + +> **Warning** +> +> These steps assume `origin` to point to the remote +> `https://github.com/vmware/govmomi`, respectively +> `git@github.com:vmware/govmomi`. + +### Create a release branch + +Pick a reference (commit, branch or tag) **before** the `v0.29.0` tag and create +a release branch from there. + +The following example creates a cherrypick release (`v0.28.1`) based on the +`v0.28.0` tag. + +```console +export RELEASE_BRANCH=release-0.28 +git checkout -b ${RELEASE_BRANCH} v0.28.0 +``` + +Optionally, incorporate (cherry-pick) commits into the branch. + +> **Warning** +> +> Make sure that these commits/ranges do not contain commits after the `v0.29.0` +> tag which include release automation changes, i.e. files in `.github/workflows/`! + +### Verify `make docs` and `CONTRIBUTORS` are up to date + +> **Warning** +> +> Run the following commands and commit any changes to the release branch before +> proceeding with the release. + +```console +make doc +./scripts/contributors.sh +if [ -z "$(git status --porcelain)" ]; then + echo "working directory clean: proceed with release" +else + echo "working directory dirty: please commit changes" +fi + +# perform git add && git commit ... in case there were changes +``` + +### Set `RELEASE_VERSION` variable + +This variable is used and referenced in the subsequent commands. Set it to the +**upcoming** release version, adhering to the [semantic +versioning](https://semver.org/) scheme: + +```console +export RELEASE_VERSION=v0.28.1 +``` + +### Create the Git Tag + +```console +git tag -a ${RELEASE_VERSION} -m "Release ${RELEASE_VERSION}" +``` + +### Push the new Tag + +```console +# Will trigger Github Actions Release Workflow +git push --atomic origin ${RELEASE_BRANCH} refs/tags/${RELEASE_VERSION} +``` + +### Verify Github Action Release Workflow + +After pushing a new release tag, the status of the workflow can be inspected +[here](https://github.com/vmware/govmomi/actions/workflows/govmomi-release.yaml). + +![Release](static/release-workflow.png "Successful Release Run") + +After a successful release, a pull request is automatically created by the +Github Actions bot to update the [CHANGELOG](CHANGELOG.md). This `CHANGELOG.md` +is also generated with `git-chglog` but uses a slightly different template +(`.chglog/CHANGELOG.tpl.md`) for rendering (issue/PR refs are excluded). diff --git a/vendor/github.com/vmware/govmomi/find/finder.go b/vendor/github.com/vmware/govmomi/find/finder.go index 03767fc353b..61ac780c45c 100644 --- a/vendor/github.com/vmware/govmomi/find/finder.go +++ b/vendor/github.com/vmware/govmomi/find/finder.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2017 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2020 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,9 +22,11 @@ import ( "path" "strings" + "github.com/vmware/govmomi/internal" "github.com/vmware/govmomi/list" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/view" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" @@ -38,16 +40,26 @@ type Finder struct { folders *object.DatacenterFolders } -func NewFinder(client *vim25.Client, all bool) *Finder { +func NewFinder(client *vim25.Client, all ...bool) *Finder { + props := false + if len(all) == 1 { + props = all[0] + } + f := &Finder{ client: client, si: object.NewSearchIndex(client), r: recurser{ Collector: property.DefaultCollector(client), - All: all, + All: props, }, } + if len(all) == 0 { + // attempt to avoid SetDatacenter() requirement + f.dc, _ = f.DefaultDatacenter(context.Background()) + } + return f } @@ -57,6 +69,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 { @@ -93,8 +117,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) @@ -109,19 +133,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:] } @@ -253,7 +268,7 @@ func (f *Finder) managedObjectList(ctx context.Context, path string, tl bool, in fn = f.dcReference } - if len(path) == 0 { + if path == "" { path = "." } @@ -271,8 +286,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 @@ -301,7 +315,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 } @@ -312,7 +326,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 { @@ -776,9 +790,26 @@ func (f *Finder) NetworkList(ctx context.Context, path string) ([]object.Network return ns, nil } +// Network finds a NetworkReference using a Name, Inventory Path, ManagedObject ID, Logical Switch UUID or Segment ID. +// With standard vSphere networking, Portgroups cannot have the same name within the same network folder. +// With NSX, Portgroups can have the same name, even within the same Switch. In this case, using an inventory path +// results in a MultipleFoundError. A MOID, switch UUID or segment ID can be used instead, as both are unique. +// See also: https://kb.vmware.com/s/article/79872#Duplicate_names +// Examples: +// - Name: "dvpg-1" +// - Inventory Path: "vds-1/dvpg-1" +// - ManagedObject ID: "DistributedVirtualPortgroup:dvportgroup-53" +// - Logical Switch UUID: "da2a59b8-2450-4cb2-b5cc-79c4c1d2144c" +// - Segment ID: "/infra/segments/vnet_ce50e69b-1784-4a14-9206-ffd7f1f146f7" func (f *Finder) Network(ctx context.Context, path string) (object.NetworkReference, error) { networks, err := f.NetworkList(ctx, path) if err != nil { + if _, ok := err.(*NotFoundError); ok { + net, nerr := f.networkByID(ctx, path) + if nerr == nil { + return net, nil + } + } return nil, err } @@ -789,6 +820,41 @@ func (f *Finder) Network(ctx context.Context, path string) (object.NetworkRefere return networks[0], nil } +func (f *Finder) networkByID(ctx context.Context, path string) (object.NetworkReference, error) { + if ref := object.ReferenceFromString(path); ref != nil { + // This is a MOID + return object.NewReference(f.client, *ref).(object.NetworkReference), nil + } + + kind := []string{"DistributedVirtualPortgroup"} + + m := view.NewManager(f.client) + v, err := m.CreateContainerView(ctx, f.client.ServiceContent.RootFolder, kind, true) + if err != nil { + return nil, err + } + defer v.Destroy(ctx) + + filter := property.Filter{ + "config.logicalSwitchUuid": path, + "config.segmentId": path, + } + + refs, err := v.FindAny(ctx, kind, filter) + if err != nil { + return nil, err + } + + if len(refs) == 0 { + return nil, &NotFoundError{"network", path} + } + if len(refs) > 1 { + return nil, &MultipleFoundError{"network", path} + } + + return object.NewReference(f.client, refs[0]).(object.NetworkReference), nil +} + func (f *Finder) DefaultNetwork(ctx context.Context) (object.NetworkReference, error) { network, err := f.Network(ctx, "*") if err != nil { diff --git a/vendor/github.com/vmware/govmomi/history/collector.go b/vendor/github.com/vmware/govmomi/history/collector.go new file mode 100644 index 00000000000..9b25ea85a14 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/history/collector.go @@ -0,0 +1,91 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package history + +import ( + "context" + + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" +) + +type Collector struct { + r types.ManagedObjectReference + c *vim25.Client +} + +func NewCollector(c *vim25.Client, ref types.ManagedObjectReference) *Collector { + return &Collector{ + r: ref, + c: c, + } +} + +// Reference returns the managed object reference of this collector +func (c Collector) Reference() types.ManagedObjectReference { + return c.r +} + +// Client returns the vim25 client used by this collector +func (c Collector) Client() *vim25.Client { + return c.c +} + +// Properties wraps property.DefaultCollector().RetrieveOne() and returns +// properties for the specified managed object reference +func (c Collector) Properties(ctx context.Context, r types.ManagedObjectReference, ps []string, dst interface{}) error { + return property.DefaultCollector(c.c).RetrieveOne(ctx, r, ps, dst) +} + +func (c Collector) Destroy(ctx context.Context) error { + req := types.DestroyCollector{ + This: c.r, + } + + _, err := methods.DestroyCollector(ctx, c.c, &req) + return err +} + +func (c Collector) Reset(ctx context.Context) error { + req := types.ResetCollector{ + This: c.r, + } + + _, err := methods.ResetCollector(ctx, c.c, &req) + return err +} + +func (c Collector) Rewind(ctx context.Context) error { + req := types.RewindCollector{ + This: c.r, + } + + _, err := methods.RewindCollector(ctx, c.c, &req) + return err +} + +func (c Collector) SetPageSize(ctx context.Context, maxCount int32) error { + req := types.SetCollectorPageSize{ + This: c.r, + MaxCount: maxCount, + } + + _, err := methods.SetCollectorPageSize(ctx, c.c, &req) + return err +} diff --git a/vendor/github.com/vmware/govmomi/internal/helpers.go b/vendor/github.com/vmware/govmomi/internal/helpers.go new file mode 100644 index 00000000000..b3eafeadfd9 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/internal/helpers.go @@ -0,0 +1,63 @@ +/* +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 ( + "net" + "path" + + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +// 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 +} + +func HostSystemManagementIPs(config []types.VirtualNicManagerNetConfig) []net.IP { + var ips []net.IP + + for _, nc := range config { + if nc.NicType != string(types.HostVirtualNicManagerNicTypeManagement) { + continue + } + for ix := range nc.CandidateVnic { + for _, selectedVnicKey := range nc.SelectedVnic { + if nc.CandidateVnic[ix].Key != selectedVnicKey { + continue + } + ip := net.ParseIP(nc.CandidateVnic[ix].Spec.Ip.IpAddress) + if ip != nil { + ips = append(ips, ip) + } + } + } + } + + return ips +} diff --git a/vendor/github.com/vmware/govmomi/internal/methods.go b/vendor/github.com/vmware/govmomi/internal/methods.go new file mode 100644 index 00000000000..95ccee8d247 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/internal/methods.go @@ -0,0 +1,123 @@ +/* +Copyright (c) 2014-2015 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "context" + + "github.com/vmware/govmomi/vim25/soap" +) + +type RetrieveDynamicTypeManagerBody struct { + Req *RetrieveDynamicTypeManagerRequest `xml:"urn:vim25 RetrieveDynamicTypeManager"` + Res *RetrieveDynamicTypeManagerResponse `xml:"urn:vim25 RetrieveDynamicTypeManagerResponse"` + Fault_ *soap.Fault +} + +func (b *RetrieveDynamicTypeManagerBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveDynamicTypeManager(ctx context.Context, r soap.RoundTripper, req *RetrieveDynamicTypeManagerRequest) (*RetrieveDynamicTypeManagerResponse, error) { + var reqBody, resBody RetrieveDynamicTypeManagerBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveManagedMethodExecuterBody struct { + Req *RetrieveManagedMethodExecuterRequest `xml:"urn:vim25 RetrieveManagedMethodExecuter"` + Res *RetrieveManagedMethodExecuterResponse `xml:"urn:vim25 RetrieveManagedMethodExecuterResponse"` + Fault_ *soap.Fault +} + +func (b *RetrieveManagedMethodExecuterBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveManagedMethodExecuter(ctx context.Context, r soap.RoundTripper, req *RetrieveManagedMethodExecuterRequest) (*RetrieveManagedMethodExecuterResponse, error) { + var reqBody, resBody RetrieveManagedMethodExecuterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DynamicTypeMgrQueryMoInstancesBody struct { + Req *DynamicTypeMgrQueryMoInstancesRequest `xml:"urn:vim25 DynamicTypeMgrQueryMoInstances"` + Res *DynamicTypeMgrQueryMoInstancesResponse `xml:"urn:vim25 DynamicTypeMgrQueryMoInstancesResponse"` + Fault_ *soap.Fault +} + +func (b *DynamicTypeMgrQueryMoInstancesBody) Fault() *soap.Fault { return b.Fault_ } + +func DynamicTypeMgrQueryMoInstances(ctx context.Context, r soap.RoundTripper, req *DynamicTypeMgrQueryMoInstancesRequest) (*DynamicTypeMgrQueryMoInstancesResponse, error) { + var reqBody, resBody DynamicTypeMgrQueryMoInstancesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DynamicTypeMgrQueryTypeInfoBody struct { + Req *DynamicTypeMgrQueryTypeInfoRequest `xml:"urn:vim25 DynamicTypeMgrQueryTypeInfo"` + Res *DynamicTypeMgrQueryTypeInfoResponse `xml:"urn:vim25 DynamicTypeMgrQueryTypeInfoResponse"` + Fault_ *soap.Fault +} + +func (b *DynamicTypeMgrQueryTypeInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func DynamicTypeMgrQueryTypeInfo(ctx context.Context, r soap.RoundTripper, req *DynamicTypeMgrQueryTypeInfoRequest) (*DynamicTypeMgrQueryTypeInfoResponse, error) { + var reqBody, resBody DynamicTypeMgrQueryTypeInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ExecuteSoapBody struct { + Req *ExecuteSoapRequest `xml:"urn:vim25 ExecuteSoap"` + Res *ExecuteSoapResponse `xml:"urn:vim25 ExecuteSoapResponse"` + Fault_ *soap.Fault +} + +func (b *ExecuteSoapBody) Fault() *soap.Fault { return b.Fault_ } + +func ExecuteSoap(ctx context.Context, r soap.RoundTripper, req *ExecuteSoapRequest) (*ExecuteSoapResponse, error) { + var reqBody, resBody ExecuteSoapBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} diff --git a/vendor/github.com/vmware/govmomi/internal/types.go b/vendor/github.com/vmware/govmomi/internal/types.go new file mode 100644 index 00000000000..b84103b89bb --- /dev/null +++ b/vendor/github.com/vmware/govmomi/internal/types.go @@ -0,0 +1,270 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package internal + +import ( + "reflect" + + "github.com/vmware/govmomi/vim25/types" +) + +type DynamicTypeMgrQueryMoInstancesRequest struct { + This types.ManagedObjectReference `xml:"_this"` + FilterSpec BaseDynamicTypeMgrFilterSpec `xml:"filterSpec,omitempty,typeattr"` +} + +type DynamicTypeMgrQueryMoInstancesResponse struct { + Returnval []DynamicTypeMgrMoInstance `xml:"urn:vim25 returnval"` +} + +type DynamicTypeEnumTypeInfo struct { + types.DynamicData + + Name string `xml:"name"` + WsdlName string `xml:"wsdlName"` + Version string `xml:"version"` + Value []string `xml:"value,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +func init() { + types.Add("DynamicTypeEnumTypeInfo", reflect.TypeOf((*DynamicTypeEnumTypeInfo)(nil)).Elem()) +} + +type DynamicTypeMgrAllTypeInfoRequest struct { + types.DynamicData + + ManagedTypeInfo []DynamicTypeMgrManagedTypeInfo `xml:"managedTypeInfo,omitempty"` + EnumTypeInfo []DynamicTypeEnumTypeInfo `xml:"enumTypeInfo,omitempty"` + DataTypeInfo []DynamicTypeMgrDataTypeInfo `xml:"dataTypeInfo,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrAllTypeInfo", reflect.TypeOf((*DynamicTypeMgrAllTypeInfoRequest)(nil)).Elem()) +} + +type DynamicTypeMgrAnnotation struct { + types.DynamicData + + Name string `xml:"name"` + Parameter []string `xml:"parameter,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrAnnotation", reflect.TypeOf((*DynamicTypeMgrAnnotation)(nil)).Elem()) +} + +type DynamicTypeMgrDataTypeInfo struct { + types.DynamicData + + Name string `xml:"name"` + WsdlName string `xml:"wsdlName"` + Version string `xml:"version"` + Base []string `xml:"base,omitempty"` + Property []DynamicTypeMgrPropertyTypeInfo `xml:"property,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrDataTypeInfo", reflect.TypeOf((*DynamicTypeMgrDataTypeInfo)(nil)).Elem()) +} + +func (b *DynamicTypeMgrFilterSpec) GetDynamicTypeMgrFilterSpec() *DynamicTypeMgrFilterSpec { return b } + +type BaseDynamicTypeMgrFilterSpec interface { + GetDynamicTypeMgrFilterSpec() *DynamicTypeMgrFilterSpec +} + +type DynamicTypeMgrFilterSpec struct { + types.DynamicData +} + +func init() { + types.Add("DynamicTypeMgrFilterSpec", reflect.TypeOf((*DynamicTypeMgrFilterSpec)(nil)).Elem()) +} + +type DynamicTypeMgrManagedTypeInfo struct { + types.DynamicData + + Name string `xml:"name"` + WsdlName string `xml:"wsdlName"` + Version string `xml:"version"` + Base []string `xml:"base,omitempty"` + Property []DynamicTypeMgrPropertyTypeInfo `xml:"property,omitempty"` + Method []DynamicTypeMgrMethodTypeInfo `xml:"method,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrManagedTypeInfo", reflect.TypeOf((*DynamicTypeMgrManagedTypeInfo)(nil)).Elem()) +} + +type DynamicTypeMgrMethodTypeInfo struct { + types.DynamicData + + Name string `xml:"name"` + WsdlName string `xml:"wsdlName"` + Version string `xml:"version"` + ParamTypeInfo []DynamicTypeMgrParamTypeInfo `xml:"paramTypeInfo,omitempty"` + ReturnTypeInfo *DynamicTypeMgrParamTypeInfo `xml:"returnTypeInfo,omitempty"` + Fault []string `xml:"fault,omitempty"` + PrivId string `xml:"privId,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrMethodTypeInfo", reflect.TypeOf((*DynamicTypeMgrMethodTypeInfo)(nil)).Elem()) +} + +type DynamicTypeMgrMoFilterSpec struct { + DynamicTypeMgrFilterSpec + + Id string `xml:"id,omitempty"` + TypeSubstr string `xml:"typeSubstr,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrMoFilterSpec", reflect.TypeOf((*DynamicTypeMgrMoFilterSpec)(nil)).Elem()) +} + +type DynamicTypeMgrMoInstance struct { + types.DynamicData + + Id string `xml:"id"` + MoType string `xml:"moType"` +} + +func init() { + types.Add("DynamicTypeMgrMoInstance", reflect.TypeOf((*DynamicTypeMgrMoInstance)(nil)).Elem()) +} + +type DynamicTypeMgrParamTypeInfo struct { + types.DynamicData + + Name string `xml:"name"` + Version string `xml:"version"` + Type string `xml:"type"` + PrivId string `xml:"privId,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrParamTypeInfo", reflect.TypeOf((*DynamicTypeMgrParamTypeInfo)(nil)).Elem()) +} + +type DynamicTypeMgrPropertyTypeInfo struct { + types.DynamicData + + Name string `xml:"name"` + Version string `xml:"version"` + Type string `xml:"type"` + PrivId string `xml:"privId,omitempty"` + MsgIdFormat string `xml:"msgIdFormat,omitempty"` + Annotation []DynamicTypeMgrAnnotation `xml:"annotation,omitempty"` +} + +type DynamicTypeMgrQueryTypeInfoRequest struct { + This types.ManagedObjectReference `xml:"_this"` + FilterSpec BaseDynamicTypeMgrFilterSpec `xml:"filterSpec,omitempty,typeattr"` +} + +type DynamicTypeMgrQueryTypeInfoResponse struct { + Returnval DynamicTypeMgrAllTypeInfoRequest `xml:"urn:vim25 returnval"` +} + +func init() { + types.Add("DynamicTypeMgrPropertyTypeInfo", reflect.TypeOf((*DynamicTypeMgrPropertyTypeInfo)(nil)).Elem()) +} + +type DynamicTypeMgrTypeFilterSpec struct { + DynamicTypeMgrFilterSpec + + TypeSubstr string `xml:"typeSubstr,omitempty"` +} + +func init() { + types.Add("DynamicTypeMgrTypeFilterSpec", reflect.TypeOf((*DynamicTypeMgrTypeFilterSpec)(nil)).Elem()) +} + +type ReflectManagedMethodExecuterSoapArgument struct { + types.DynamicData + + Name string `xml:"name"` + Val string `xml:"val"` +} + +func init() { + types.Add("ReflectManagedMethodExecuterSoapArgument", reflect.TypeOf((*ReflectManagedMethodExecuterSoapArgument)(nil)).Elem()) +} + +type ReflectManagedMethodExecuterSoapFault struct { + types.DynamicData + + FaultMsg string `xml:"faultMsg"` + FaultDetail string `xml:"faultDetail,omitempty"` +} + +func init() { + types.Add("ReflectManagedMethodExecuterSoapFault", reflect.TypeOf((*ReflectManagedMethodExecuterSoapFault)(nil)).Elem()) +} + +type ReflectManagedMethodExecuterSoapResult struct { + types.DynamicData + + Response string `xml:"response,omitempty"` + Fault *ReflectManagedMethodExecuterSoapFault `xml:"fault,omitempty"` +} + +type RetrieveDynamicTypeManagerRequest struct { + This types.ManagedObjectReference `xml:"_this"` +} + +type RetrieveDynamicTypeManagerResponse struct { + Returnval *InternalDynamicTypeManager `xml:"urn:vim25 returnval"` +} + +type RetrieveManagedMethodExecuterRequest struct { + This types.ManagedObjectReference `xml:"_this"` +} + +func init() { + types.Add("RetrieveManagedMethodExecuter", reflect.TypeOf((*RetrieveManagedMethodExecuterRequest)(nil)).Elem()) +} + +type RetrieveManagedMethodExecuterResponse struct { + Returnval *ReflectManagedMethodExecuter `xml:"urn:vim25 returnval"` +} + +type InternalDynamicTypeManager struct { + types.ManagedObjectReference +} + +type ReflectManagedMethodExecuter struct { + types.ManagedObjectReference +} + +type ExecuteSoapRequest struct { + This types.ManagedObjectReference `xml:"_this"` + Moid string `xml:"moid"` + Version string `xml:"version"` + Method string `xml:"method"` + Argument []ReflectManagedMethodExecuterSoapArgument `xml:"argument,omitempty"` +} + +type ExecuteSoapResponse struct { + Returnval *ReflectManagedMethodExecuterSoapResult `xml:"urn:vim25 returnval"` +} diff --git a/vendor/github.com/vmware/govmomi/internal/version/version.go b/vendor/github.com/vmware/govmomi/internal/version/version.go new file mode 100644 index 00000000000..b141a9597ed --- /dev/null +++ b/vendor/github.com/vmware/govmomi/internal/version/version.go @@ -0,0 +1,25 @@ +/* +Copyright (c) 2014-2022 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package version + +const ( + // ClientName is the name of this SDK + ClientName = "govmomi" + + // ClientVersion is the version of this SDK + ClientVersion = "0.30.0" +) diff --git a/vendor/github.com/vmware/govmomi/list/lister.go b/vendor/github.com/vmware/govmomi/list/lister.go index 2ee32e6bc17..9a4caed6862 100644 --- a/vendor/github.com/vmware/govmomi/list/lister.go +++ b/vendor/github.com/vmware/govmomi/list/lister.go @@ -165,6 +165,8 @@ func (l Lister) List(ctx context.Context) ([]Element, error) { return l.ListHostSystem(ctx) case "VirtualApp": return l.ListVirtualApp(ctx) + case "VmwareDistributedVirtualSwitch", "DistributedVirtualSwitch": + return l.ListDistributedVirtualSwitch(ctx) default: return nil, fmt.Errorf("cannot traverse type " + l.Reference.Type) } @@ -497,6 +499,69 @@ func (l Lister) ListHostSystem(ctx context.Context) ([]Element, error) { return es, nil } +func (l Lister) ListDistributedVirtualSwitch(ctx context.Context) ([]Element, error) { + ospec := types.ObjectSpec{ + Obj: l.Reference, + Skip: types.NewBool(true), + } + + fields := []string{ + "portgroup", + } + + for _, f := range fields { + tspec := types.TraversalSpec{ + Path: f, + Skip: types.NewBool(false), + Type: "DistributedVirtualSwitch", + } + + ospec.SelectSet = append(ospec.SelectSet, &tspec) + } + + childTypes := []string{ + "DistributedVirtualPortgroup", + } + + var pspecs []types.PropertySpec + for _, t := range childTypes { + pspec := types.PropertySpec{ + Type: t, + } + + if l.All { + pspec.All = types.NewBool(true) + } else { + pspec.PathSet = []string{"name"} + } + + pspecs = append(pspecs, pspec) + } + + req := types.RetrieveProperties{ + SpecSet: []types.PropertyFilterSpec{ + { + ObjectSet: []types.ObjectSpec{ospec}, + PropSet: pspecs, + }, + }, + } + + var dst []interface{} + + err := l.retrieveProperties(ctx, req, &dst) + if err != nil { + return nil, err + } + + es := []Element{} + for _, v := range dst { + es = append(es, ToElement(v.(mo.Reference), l.Prefix)) + } + + return es, nil +} + func (l Lister) ListVirtualApp(ctx context.Context) ([]Element, error) { ospec := types.ObjectSpec{ Obj: l.Reference, diff --git a/vendor/github.com/vmware/govmomi/lookup/client.go b/vendor/github.com/vmware/govmomi/lookup/client.go index 896909fceed..b3c19846a10 100644 --- a/vendor/github.com/vmware/govmomi/lookup/client.go +++ b/vendor/github.com/vmware/govmomi/lookup/client.go @@ -25,6 +25,7 @@ import ( "github.com/vmware/govmomi/lookup/methods" "github.com/vmware/govmomi/lookup/types" + "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/soap" vim "github.com/vmware/govmomi/vim25/types" @@ -47,12 +48,28 @@ var ( type Client struct { *soap.Client + RoundTripper soap.RoundTripper + ServiceContent types.LookupServiceContent } // NewClient returns a client targeting the SSO Lookup Service API endpoint. func NewClient(ctx context.Context, c *vim25.Client) (*Client, error) { - sc := c.Client.NewServiceClient(Path, Namespace) + // PSC may be external, attempt to derive from sts.uri + path := &url.URL{Path: Path} + if c.ServiceContent.Setting != nil { + m := object.NewOptionManager(c, *c.ServiceContent.Setting) + opts, err := m.Query(ctx, "config.vpxd.sso.sts.uri") + if err == nil && len(opts) == 1 { + u, err := url.Parse(opts[0].GetOptionValue().Value.(string)) + if err == nil { + path.Scheme = u.Scheme + path.Host = u.Host + } + } + } + + sc := c.Client.NewServiceClient(path.String(), Namespace) sc.Version = Version req := types.RetrieveServiceContent{ @@ -64,7 +81,12 @@ func NewClient(ctx context.Context, c *vim25.Client) (*Client, error) { return nil, err } - return &Client{sc, res.Returnval}, nil + return &Client{sc, sc, res.Returnval}, 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) List(ctx context.Context, filter *types.LookupServiceRegistrationFilter) ([]types.LookupServiceRegistrationInfo, error) { diff --git a/vendor/github.com/vmware/govmomi/lookup/simulator/registration_info.go b/vendor/github.com/vmware/govmomi/lookup/simulator/registration_info.go index b1b1eea84d4..4ec697112b0 100644 --- a/vendor/github.com/vmware/govmomi/lookup/simulator/registration_info.go +++ b/vendor/github.com/vmware/govmomi/lookup/simulator/registration_info.go @@ -18,6 +18,7 @@ package simulator import ( "github.com/google/uuid" + "github.com/vmware/govmomi/lookup" "github.com/vmware/govmomi/lookup/types" "github.com/vmware/govmomi/simulator" @@ -33,6 +34,7 @@ var ( func registrationInfo() []types.LookupServiceRegistrationInfo { vc := simulator.Map.Get(vim25.ServiceInstance).(*simulator.ServiceInstance) setting := simulator.Map.OptionManager().Setting + sm := simulator.Map.SessionManager() opts := make(map[string]string, len(setting)) for _, o := range setting { @@ -42,14 +44,17 @@ func registrationInfo() []types.LookupServiceRegistrationInfo { } } - trust := []string{opts["vcsim.server.cert"]} + trust := []string{""} + if sm.TLSCert != nil { + trust[0] = sm.TLSCert() + } sdk := opts["vcsim.server.url"] + vim25.Path admin := opts["config.vpxd.sso.default.admin"] owner := opts["config.vpxd.sso.solutionUser.name"] instance := opts["VirtualCenter.InstanceName"] // Real PSC has 30+ services by default, we just provide a few that are useful for vmomi interaction.. - return []types.LookupServiceRegistrationInfo{ + info := []types.LookupServiceRegistrationInfo{ { LookupServiceRegistrationCommonServiceInfo: types.LookupServiceRegistrationCommonServiceInfo{ LookupServiceRegistrationMutableServiceInfo: types.LookupServiceRegistrationMutableServiceInfo{ @@ -68,7 +73,7 @@ func registrationInfo() []types.LookupServiceRegistrationInfo { OwnerId: admin, ServiceType: types.LookupServiceRegistrationServiceType{ Product: "com.vmware.cis", - Type: "sso:sts", + Type: "cs.identity", }, }, ServiceId: siteID + ":" + uuid.New().String(), @@ -126,4 +131,9 @@ func registrationInfo() []types.LookupServiceRegistrationInfo { SiteId: siteID, }, } + + sts := info[0] + sts.ServiceType.Type = "sso:sts" // obsolete service type, but still used by PowerCLI + + return append(info, sts) } diff --git a/vendor/github.com/vmware/govmomi/lookup/simulator/simulator.go b/vendor/github.com/vmware/govmomi/lookup/simulator/simulator.go index d066d5fd6d0..d452f2f6672 100644 --- a/vendor/github.com/vmware/govmomi/lookup/simulator/simulator.go +++ b/vendor/github.com/vmware/govmomi/lookup/simulator/simulator.go @@ -17,6 +17,8 @@ limitations under the License. package simulator import ( + "sync" + "github.com/vmware/govmomi/lookup" "github.com/vmware/govmomi/lookup/methods" "github.com/vmware/govmomi/lookup/types" @@ -32,6 +34,14 @@ var content = types.LookupServiceContent{ L10n: vim.ManagedObjectReference{Type: "LookupL10n", Value: "l10n"}, } +func init() { + simulator.RegisterEndpoint(func(s *simulator.Service, r *simulator.Registry) { + if r.IsVPX() { + s.RegisterSDK(New()) + } + }) +} + func New() *simulator.Registry { r := simulator.NewRegistry() r.Namespace = lookup.Namespace @@ -40,10 +50,12 @@ func New() *simulator.Registry { r.Put(&ServiceInstance{ ManagedObjectReference: lookup.ServiceInstance, Content: content, - }) - r.Put(&ServiceRegistration{ - ManagedObjectReference: *content.ServiceRegistration, - Info: registrationInfo(), + register: func() { + r.Put(&ServiceRegistration{ + ManagedObjectReference: *content.ServiceRegistration, + Info: registrationInfo(), + }) + }, }) return r @@ -53,9 +65,16 @@ type ServiceInstance struct { vim.ManagedObjectReference Content types.LookupServiceContent + + instance sync.Once + register func() } func (s *ServiceInstance) RetrieveServiceContent(_ *types.RetrieveServiceContent) soap.HasFault { + // defer register to this point to ensure we can include vcsim's cert in ServiceEndpoints.SslTrust + // TODO: we should be able to register within New(), but this is the only place that currently depends on vcsim's cert. + s.instance.Do(s.register) + return &methods.RetrieveServiceContentBody{ Res: &types.RetrieveServiceContentResponse{ Returnval: s.Content, diff --git a/vendor/github.com/vmware/govmomi/nfc/lease.go b/vendor/github.com/vmware/govmomi/nfc/lease.go index 3fb85ee6f6e..45756803362 100644 --- a/vendor/github.com/vmware/govmomi/nfc/lease.go +++ b/vendor/github.com/vmware/govmomi/nfc/lease.go @@ -18,16 +18,15 @@ 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" - "github.com/vmware/govmomi/vim25/progress" "github.com/vmware/govmomi/vim25/soap" "github.com/vmware/govmomi/vim25/types" ) @@ -195,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) @@ -208,8 +207,6 @@ func (l *Lease) StartUpdater(ctx context.Context, info *LeaseInfo) *LeaseUpdater func (l *Lease) Upload(ctx context.Context, item FileItem, f io.Reader, opts soap.Upload) error { if opts.Progress == nil { opts.Progress = item - } else { - opts.Progress = progress.Tee(item, opts.Progress) } // Non-disk files (such as .iso) use the PUT method. @@ -230,8 +227,6 @@ func (l *Lease) Upload(ctx context.Context, item FileItem, f io.Reader, opts soa func (l *Lease) DownloadFile(ctx context.Context, file string, item FileItem, opts soap.Download) error { if opts.Progress == nil { opts.Progress = item - } else { - opts.Progress = progress.Tee(item, opts.Progress) } return l.c.DownloadFile(ctx, file, item.URL, &opts) diff --git a/vendor/github.com/vmware/govmomi/nfc/lease_updater.go b/vendor/github.com/vmware/govmomi/nfc/lease_updater.go index d77c3596aee..02ce9cf5372 100644 --- a/vendor/github.com/vmware/govmomi/nfc/lease_updater.go +++ b/vendor/github.com/vmware/govmomi/nfc/lease_updater.go @@ -57,8 +57,8 @@ func (o FileItem) File() types.OvfFile { } type LeaseUpdater struct { - pos int64 // Number of bytes (keep first to ensure 64 bit aligment) - total int64 // Total number of bytes (keep first to ensure 64 bit aligment) + pos int64 // Number of bytes (keep first to ensure 64 bit alignment) + total int64 // Total number of bytes (keep first to ensure 64 bit alignment) lease *Lease diff --git a/vendor/github.com/vmware/govmomi/object/authorization_manager.go b/vendor/github.com/vmware/govmomi/object/authorization_manager.go index b703258fe7a..5cd6851a87d 100644 --- a/vendor/github.com/vmware/govmomi/object/authorization_manager.go +++ b/vendor/github.com/vmware/govmomi/object/authorization_manager.go @@ -172,3 +172,50 @@ func (m AuthorizationManager) UpdateRole(ctx context.Context, id int32, name str _, err := methods.UpdateAuthorizationRole(ctx, m.Client(), &req) return err } + +func (m AuthorizationManager) HasUserPrivilegeOnEntities(ctx context.Context, entities []types.ManagedObjectReference, userName string, privID []string) ([]types.EntityPrivilege, error) { + req := types.HasUserPrivilegeOnEntities{ + This: m.Reference(), + Entities: entities, + UserName: userName, + PrivId: privID, + } + + res, err := methods.HasUserPrivilegeOnEntities(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (m AuthorizationManager) HasPrivilegeOnEntity(ctx context.Context, entity types.ManagedObjectReference, sessionID string, privID []string) ([]bool, error) { + req := types.HasPrivilegeOnEntity{ + This: m.Reference(), + Entity: entity, + SessionId: sessionID, + PrivId: privID, + } + + res, err := methods.HasPrivilegeOnEntity(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (m AuthorizationManager) FetchUserPrivilegeOnEntities(ctx context.Context, entities []types.ManagedObjectReference, userName string) ([]types.UserPrivilegeResult, error) { + req := types.FetchUserPrivilegeOnEntities{ + This: m.Reference(), + Entities: entities, + UserName: userName, + } + + res, err := methods.FetchUserPrivilegeOnEntities(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} diff --git a/vendor/github.com/vmware/govmomi/object/cluster_compute_resource.go b/vendor/github.com/vmware/govmomi/object/cluster_compute_resource.go index 24c346825ad..018372dfe08 100644 --- a/vendor/github.com/vmware/govmomi/object/cluster_compute_resource.go +++ b/vendor/github.com/vmware/govmomi/object/cluster_compute_resource.go @@ -87,3 +87,17 @@ func (c ClusterComputeResource) MoveInto(ctx context.Context, hosts ...*HostSyst return NewTask(c.c, res.Returnval), nil } + +func (c ClusterComputeResource) PlaceVm(ctx context.Context, spec types.PlacementSpec) (*types.PlacementResult, error) { + req := types.PlaceVm{ + This: c.Reference(), + PlacementSpec: spec, + } + + res, err := methods.PlaceVm(ctx, c.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} diff --git a/vendor/github.com/vmware/govmomi/object/common.go b/vendor/github.com/vmware/govmomi/object/common.go index abb4076c7fa..88ce78fce52 100644 --- a/vendor/github.com/vmware/govmomi/object/common.go +++ b/vendor/github.com/vmware/govmomi/object/common.go @@ -75,29 +75,22 @@ func (c *Common) SetInventoryPath(p string) { c.InventoryPath = p } -// ObjectName returns the base name of the InventoryPath field if set, -// otherwise fetches the mo.ManagedEntity.Name field via the property collector. +// ObjectName fetches the mo.ManagedEntity.Name field via the property collector. func (c Common) ObjectName(ctx context.Context) (string, error) { - var o mo.ManagedEntity + var content []types.ObjectContent - err := c.Properties(ctx, c.Reference(), []string{"name"}, &o) + err := c.Properties(ctx, c.Reference(), []string{"name"}, &content) if err != nil { return "", err } - if o.Name != "" { - return o.Name, nil + for i := range content { + for _, prop := range content[i].PropSet { + return prop.Val.(string), nil + } } - // Network has its own "name" field... - var n mo.Network - - err = c.Properties(ctx, c.Reference(), []string{"name"}, &n) - if err != nil { - return "", err - } - - return n.Name, nil + return "", nil } // Properties is a wrapper for property.DefaultCollector().RetrieveOne() @@ -142,3 +135,14 @@ func (c Common) SetCustomValue(ctx context.Context, key string, value string) er _, err := methods.SetCustomValue(ctx, c.c, &req) return err } + +func ReferenceFromString(s string) *types.ManagedObjectReference { + var ref types.ManagedObjectReference + if !ref.FromString(s) { + return nil + } + if mo.IsManagedObjectType(ref.Type) { + return &ref + } + return nil +} diff --git a/vendor/github.com/vmware/govmomi/object/customization_spec_manager.go b/vendor/github.com/vmware/govmomi/object/customization_spec_manager.go index cb8b965dc6e..e9a3914d9da 100644 --- a/vendor/github.com/vmware/govmomi/object/customization_spec_manager.go +++ b/vendor/github.com/vmware/govmomi/object/customization_spec_manager.go @@ -21,6 +21,7 @@ import ( "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" ) @@ -36,6 +37,12 @@ func NewCustomizationSpecManager(c *vim25.Client) *CustomizationSpecManager { return &cs } +func (cs CustomizationSpecManager) Info(ctx context.Context) ([]types.CustomizationSpecInfo, error) { + var m mo.CustomizationSpecManager + err := cs.Properties(ctx, cs.Reference(), []string{"info"}, &m) + return m.Info, err +} + func (cs CustomizationSpecManager) DoesCustomizationSpecExist(ctx context.Context, name string) (bool, error) { req := types.DoesCustomizationSpecExist{ This: cs.Reference(), diff --git a/vendor/github.com/vmware/govmomi/object/datastore.go b/vendor/github.com/vmware/govmomi/object/datastore.go index 46a99950a62..65264ae152d 100644 --- a/vendor/github.com/vmware/govmomi/object/datastore.go +++ b/vendor/github.com/vmware/govmomi/object/datastore.go @@ -68,6 +68,11 @@ func NewDatastore(c *vim25.Client, ref types.ManagedObjectReference) *Datastore } func (d Datastore) Path(path string) string { + var p DatastorePath + if p.FromString(path) { + return p.String() // already in "[datastore] path" format + } + return (&DatastorePath{ Datastore: d.Name(), Path: path, diff --git a/vendor/github.com/vmware/govmomi/object/datastore_file.go b/vendor/github.com/vmware/govmomi/object/datastore_file.go index bc010fc36e8..86d7d9c728f 100644 --- a/vendor/github.com/vmware/govmomi/object/datastore_file.go +++ b/vendor/github.com/vmware/govmomi/object/datastore_file.go @@ -297,10 +297,8 @@ func (f *DatastoreFile) TailFunc(lines int, include func(line int, message strin nread = bsize + remain eof = true - } else { - if pos, err = f.Seek(offset, io.SeekEnd); err != nil { - return err - } + } else if pos, err = f.Seek(offset, io.SeekEnd); err != nil { + return err } if _, err = io.CopyN(buf, f, nread); err != nil { diff --git a/vendor/github.com/vmware/govmomi/object/datastore_path.go b/vendor/github.com/vmware/govmomi/object/datastore_path.go index 1563ee1e11d..104c7dfe35e 100644 --- a/vendor/github.com/vmware/govmomi/object/datastore_path.go +++ b/vendor/github.com/vmware/govmomi/object/datastore_path.go @@ -31,7 +31,7 @@ type DatastorePath struct { // FromString parses a datastore path. // Returns true if the path could be parsed, false otherwise. func (p *DatastorePath) FromString(s string) bool { - if len(s) == 0 { + if s == "" { return false } diff --git a/vendor/github.com/vmware/govmomi/object/diagnostic_manager.go b/vendor/github.com/vmware/govmomi/object/diagnostic_manager.go index 5baf1ad9038..026dc1cb5e6 100644 --- a/vendor/github.com/vmware/govmomi/object/diagnostic_manager.go +++ b/vendor/github.com/vmware/govmomi/object/diagnostic_manager.go @@ -71,10 +71,8 @@ func (m DiagnosticManager) GenerateLogBundles(ctx context.Context, includeDefaul IncludeDefault: includeDefault, } - if host != nil { - for _, h := range host { - req.Host = append(req.Host, h.Reference()) - } + for _, h := range host { + req.Host = append(req.Host, h.Reference()) } res, err := methods.GenerateLogBundles_Task(ctx, m.c, &req) diff --git a/vendor/github.com/vmware/govmomi/object/distributed_virtual_portgroup.go b/vendor/github.com/vmware/govmomi/object/distributed_virtual_portgroup.go index f8ac5512c1f..c2abb8fabde 100644 --- a/vendor/github.com/vmware/govmomi/object/distributed_virtual_portgroup.go +++ b/vendor/github.com/vmware/govmomi/object/distributed_virtual_portgroup.go @@ -36,6 +36,10 @@ func NewDistributedVirtualPortgroup(c *vim25.Client, ref types.ManagedObjectRefe } } +func (p DistributedVirtualPortgroup) GetInventoryPath() string { + return p.InventoryPath +} + // EthernetCardBackingInfo returns the VirtualDeviceBackingInfo for this DistributedVirtualPortgroup func (p DistributedVirtualPortgroup) EthernetCardBackingInfo(ctx context.Context) (types.BaseVirtualDeviceBackingInfo, error) { var dvp mo.DistributedVirtualPortgroup @@ -46,9 +50,15 @@ func (p DistributedVirtualPortgroup) EthernetCardBackingInfo(ctx context.Context return nil, err } + // From the docs at https://code.vmware.com/apis/196/vsphere/doc/vim.dvs.DistributedVirtualPortgroup.ConfigInfo.html: // "This property should always be set unless the user's setting does not have System.Read privilege on the object referred to by this property." + // Note that "the object" refers to the Switch, not the PortGroup. if dvp.Config.DistributedVirtualSwitch == nil { - return nil, fmt.Errorf("no System.Read privilege on: %s.%s", p.Reference(), prop) + name := p.InventoryPath + if name == "" { + name = p.Reference().String() + } + return nil, fmt.Errorf("failed to create EthernetCardBackingInfo for %s: System.Read privilege required for %s", name, prop) } if err := p.Properties(ctx, *dvp.Config.DistributedVirtualSwitch, []string{"uuid"}, &dvs); err != nil { diff --git a/vendor/github.com/vmware/govmomi/object/distributed_virtual_switch.go b/vendor/github.com/vmware/govmomi/object/distributed_virtual_switch.go index 526ce4bf787..66650e1d06b 100644 --- a/vendor/github.com/vmware/govmomi/object/distributed_virtual_switch.go +++ b/vendor/github.com/vmware/govmomi/object/distributed_virtual_switch.go @@ -18,6 +18,7 @@ package object import ( "context" + "fmt" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/methods" @@ -34,8 +35,17 @@ func NewDistributedVirtualSwitch(c *vim25.Client, ref types.ManagedObjectReferen } } +func (s DistributedVirtualSwitch) GetInventoryPath() string { + return s.InventoryPath +} + func (s DistributedVirtualSwitch) EthernetCardBackingInfo(ctx context.Context) (types.BaseVirtualDeviceBackingInfo, error) { - return nil, ErrNotSupported // TODO: just to satisfy NetworkReference interface for the finder + ref := s.Reference() + name := s.InventoryPath + if name == "" { + name = ref.String() + } + return nil, fmt.Errorf("type %s (%s) cannot be used for EthernetCardBackingInfo", ref.Type, name) } func (s DistributedVirtualSwitch) Reconfigure(ctx context.Context, spec types.BaseDVSConfigSpec) (*Task, error) { @@ -78,3 +88,31 @@ func (s DistributedVirtualSwitch) FetchDVPorts(ctx context.Context, criteria *ty } return res.Returnval, nil } + +func (s DistributedVirtualSwitch) ReconfigureDVPort(ctx context.Context, spec []types.DVPortConfigSpec) (*Task, error) { + req := types.ReconfigureDVPort_Task{ + This: s.Reference(), + Port: spec, + } + + res, err := methods.ReconfigureDVPort_Task(ctx, s.Client(), &req) + if err != nil { + return nil, err + } + + return NewTask(s.Client(), res.Returnval), nil +} + +func (s DistributedVirtualSwitch) ReconfigureLACP(ctx context.Context, spec []types.VMwareDvsLacpGroupSpec) (*Task, error) { + req := types.UpdateDVSLacpGroupConfig_Task{ + This: s.Reference(), + LacpGroupSpec: spec, + } + + res, err := methods.UpdateDVSLacpGroupConfig_Task(ctx, s.Client(), &req) + if err != nil { + return nil, err + } + + return NewTask(s.Client(), res.Returnval), nil +} diff --git a/vendor/github.com/vmware/govmomi/object/folder.go b/vendor/github.com/vmware/govmomi/object/folder.go index 7a69949f95a..6e0a7649b9d 100644 --- a/vendor/github.com/vmware/govmomi/object/folder.go +++ b/vendor/github.com/vmware/govmomi/object/folder.go @@ -225,3 +225,17 @@ func (f Folder) MoveInto(ctx context.Context, list []types.ManagedObjectReferenc return NewTask(f.c, res.Returnval), nil } + +func (f Folder) PlaceVmsXCluster(ctx context.Context, spec types.PlaceVmsXClusterSpec) (*types.PlaceVmsXClusterResult, error) { + req := types.PlaceVmsXCluster{ + This: f.Reference(), + PlacementSpec: spec, + } + + res, err := methods.PlaceVmsXCluster(ctx, f.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} diff --git a/vendor/github.com/vmware/govmomi/object/history_collector.go b/vendor/github.com/vmware/govmomi/object/history_collector.go deleted file mode 100644 index afdcab78b60..00000000000 --- a/vendor/github.com/vmware/govmomi/object/history_collector.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package object - -import ( - "context" - - "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/methods" - "github.com/vmware/govmomi/vim25/types" -) - -type HistoryCollector struct { - Common -} - -func NewHistoryCollector(c *vim25.Client, ref types.ManagedObjectReference) *HistoryCollector { - return &HistoryCollector{ - Common: NewCommon(c, ref), - } -} - -func (h HistoryCollector) Destroy(ctx context.Context) error { - req := types.DestroyCollector{ - This: h.Reference(), - } - - _, err := methods.DestroyCollector(ctx, h.c, &req) - return err -} - -func (h HistoryCollector) Reset(ctx context.Context) error { - req := types.ResetCollector{ - This: h.Reference(), - } - - _, err := methods.ResetCollector(ctx, h.c, &req) - return err -} - -func (h HistoryCollector) Rewind(ctx context.Context) error { - req := types.RewindCollector{ - This: h.Reference(), - } - - _, err := methods.RewindCollector(ctx, h.c, &req) - return err -} - -func (h HistoryCollector) SetPageSize(ctx context.Context, maxCount int32) error { - req := types.SetCollectorPageSize{ - This: h.Reference(), - MaxCount: maxCount, - } - - _, err := methods.SetCollectorPageSize(ctx, h.c, &req) - return err -} diff --git a/vendor/github.com/vmware/govmomi/object/host_config_manager.go b/vendor/github.com/vmware/govmomi/object/host_config_manager.go index 123227ecc70..eac59a32eb4 100644 --- a/vendor/github.com/vmware/govmomi/object/host_config_manager.go +++ b/vendor/github.com/vmware/govmomi/object/host_config_manager.go @@ -18,9 +18,9 @@ package object import ( "context" + "fmt" "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" ) @@ -34,163 +34,138 @@ func NewHostConfigManager(c *vim25.Client, ref types.ManagedObjectReference) *Ho } } -func (m HostConfigManager) DatastoreSystem(ctx context.Context) (*HostDatastoreSystem, error) { - var h mo.HostSystem +// reference returns the ManagedObjectReference for the given HostConfigManager property name. +// An error is returned if the field is nil, of type ErrNotSupported if versioned is true. +func (m HostConfigManager) reference(ctx context.Context, name string, versioned ...bool) (types.ManagedObjectReference, error) { + prop := "configManager." + name + var content []types.ObjectContent - err := m.Properties(ctx, m.Reference(), []string{"configManager.datastoreSystem"}, &h) + err := m.Properties(ctx, m.Reference(), []string{prop}, &content) + if err != nil { + return types.ManagedObjectReference{}, err + } + + for _, c := range content { + for _, p := range c.PropSet { + if p.Name != prop { + continue + } + if ref, ok := p.Val.(types.ManagedObjectReference); ok { + return ref, nil + } + } + } + + err = fmt.Errorf("%s %s is nil", m.Reference(), prop) + if len(versioned) == 1 && versioned[0] { + err = ErrNotSupported + } + return types.ManagedObjectReference{}, err +} + +func (m HostConfigManager) DatastoreSystem(ctx context.Context) (*HostDatastoreSystem, error) { + ref, err := m.reference(ctx, "datastoreSystem") if err != nil { return nil, err } - - return NewHostDatastoreSystem(m.c, *h.ConfigManager.DatastoreSystem), nil + return NewHostDatastoreSystem(m.c, ref), nil } func (m HostConfigManager) NetworkSystem(ctx context.Context) (*HostNetworkSystem, error) { - var h mo.HostSystem - - err := m.Properties(ctx, m.Reference(), []string{"configManager.networkSystem"}, &h) + ref, err := m.reference(ctx, "networkSystem") if err != nil { return nil, err } - - return NewHostNetworkSystem(m.c, *h.ConfigManager.NetworkSystem), nil + return NewHostNetworkSystem(m.c, ref), nil } func (m HostConfigManager) FirewallSystem(ctx context.Context) (*HostFirewallSystem, error) { - var h mo.HostSystem - - err := m.Properties(ctx, m.Reference(), []string{"configManager.firewallSystem"}, &h) + ref, err := m.reference(ctx, "firewallSystem") if err != nil { return nil, err } - return NewHostFirewallSystem(m.c, *h.ConfigManager.FirewallSystem), nil + return NewHostFirewallSystem(m.c, ref), nil } func (m HostConfigManager) StorageSystem(ctx context.Context) (*HostStorageSystem, error) { - var h mo.HostSystem - - err := m.Properties(ctx, m.Reference(), []string{"configManager.storageSystem"}, &h) + ref, err := m.reference(ctx, "storageSystem") if err != nil { return nil, err } - - return NewHostStorageSystem(m.c, *h.ConfigManager.StorageSystem), nil + return NewHostStorageSystem(m.c, ref), nil } func (m HostConfigManager) VirtualNicManager(ctx context.Context) (*HostVirtualNicManager, error) { - var h mo.HostSystem - - err := m.Properties(ctx, m.Reference(), []string{"configManager.virtualNicManager"}, &h) + ref, err := m.reference(ctx, "virtualNicManager") if err != nil { return nil, err } - - return NewHostVirtualNicManager(m.c, *h.ConfigManager.VirtualNicManager, m.Reference()), nil + return NewHostVirtualNicManager(m.c, ref, m.Reference()), nil } func (m HostConfigManager) VsanSystem(ctx context.Context) (*HostVsanSystem, error) { - var h mo.HostSystem - - err := m.Properties(ctx, m.Reference(), []string{"configManager.vsanSystem"}, &h) + ref, err := m.reference(ctx, "vsanSystem", true) // Added in 5.5 if err != nil { return nil, err } - - // Added in 5.5 - if h.ConfigManager.VsanSystem == nil { - return nil, ErrNotSupported - } - - return NewHostVsanSystem(m.c, *h.ConfigManager.VsanSystem), nil + return NewHostVsanSystem(m.c, ref), nil } func (m HostConfigManager) VsanInternalSystem(ctx context.Context) (*HostVsanInternalSystem, error) { - var h mo.HostSystem - - err := m.Properties(ctx, m.Reference(), []string{"configManager.vsanInternalSystem"}, &h) + ref, err := m.reference(ctx, "vsanInternalSystem", true) // Added in 5.5 if err != nil { return nil, err } - - // Added in 5.5 - if h.ConfigManager.VsanInternalSystem == nil { - return nil, ErrNotSupported - } - - return NewHostVsanInternalSystem(m.c, *h.ConfigManager.VsanInternalSystem), nil + return NewHostVsanInternalSystem(m.c, ref), nil } func (m HostConfigManager) AccountManager(ctx context.Context) (*HostAccountManager, error) { - var h mo.HostSystem - - err := m.Properties(ctx, m.Reference(), []string{"configManager.accountManager"}, &h) + ref, err := m.reference(ctx, "accountManager", true) // Added in 5.5 if err != nil { - return nil, err - } - - ref := h.ConfigManager.AccountManager // Added in 6.0 - if ref == nil { - // Versions < 5.5 can use the ServiceContent ref, - // but we can only use it when connected directly to ESX. - c := m.Client() - if !c.IsVC() { - ref = c.ServiceContent.AccountManager - } - - if ref == nil { - return nil, ErrNotSupported + if err == ErrNotSupported { + // Versions < 5.5 can use the ServiceContent ref, + // but only when connected directly to ESX. + if m.c.ServiceContent.AccountManager == nil { + return nil, err + } + ref = *m.c.ServiceContent.AccountManager + } else { + return nil, err } } - return NewHostAccountManager(m.c, *ref), nil + return NewHostAccountManager(m.c, ref), nil } func (m HostConfigManager) OptionManager(ctx context.Context) (*OptionManager, error) { - var h mo.HostSystem - - err := m.Properties(ctx, m.Reference(), []string{"configManager.advancedOption"}, &h) + ref, err := m.reference(ctx, "advancedOption") if err != nil { return nil, err } - - return NewOptionManager(m.c, *h.ConfigManager.AdvancedOption), nil + return NewOptionManager(m.c, ref), nil } func (m HostConfigManager) ServiceSystem(ctx context.Context) (*HostServiceSystem, error) { - var h mo.HostSystem - - err := m.Properties(ctx, m.Reference(), []string{"configManager.serviceSystem"}, &h) + ref, err := m.reference(ctx, "serviceSystem") if err != nil { return nil, err } - - return NewHostServiceSystem(m.c, *h.ConfigManager.ServiceSystem), nil + return NewHostServiceSystem(m.c, ref), nil } func (m HostConfigManager) CertificateManager(ctx context.Context) (*HostCertificateManager, error) { - var h mo.HostSystem - - err := m.Properties(ctx, m.Reference(), []string{"configManager.certificateManager"}, &h) + ref, err := m.reference(ctx, "certificateManager", true) // Added in 6.0 if err != nil { return nil, err } - - // Added in 6.0 - if h.ConfigManager.CertificateManager == nil { - return nil, ErrNotSupported - } - - return NewHostCertificateManager(m.c, *h.ConfigManager.CertificateManager, m.Reference()), nil + return NewHostCertificateManager(m.c, ref, m.Reference()), nil } func (m HostConfigManager) DateTimeSystem(ctx context.Context) (*HostDateTimeSystem, error) { - var h mo.HostSystem - - err := m.Properties(ctx, m.Reference(), []string{"configManager.dateTimeSystem"}, &h) + ref, err := m.reference(ctx, "dateTimeSystem") if err != nil { return nil, err } - - return NewHostDateTimeSystem(m.c, *h.ConfigManager.DateTimeSystem), nil + return NewHostDateTimeSystem(m.c, ref), nil } diff --git a/vendor/github.com/vmware/govmomi/object/host_datastore_system.go b/vendor/github.com/vmware/govmomi/object/host_datastore_system.go index 7b738e611ed..64f3add917e 100644 --- a/vendor/github.com/vmware/govmomi/object/host_datastore_system.go +++ b/vendor/github.com/vmware/govmomi/object/host_datastore_system.go @@ -117,3 +117,19 @@ func (s HostDatastoreSystem) QueryVmfsDatastoreCreateOptions(ctx context.Context return res.Returnval, nil } + +func (s HostDatastoreSystem) ResignatureUnresolvedVmfsVolumes(ctx context.Context, devicePaths []string) (*Task, error) { + req := &types.ResignatureUnresolvedVmfsVolume_Task{ + This: s.Reference(), + ResolutionSpec: types.HostUnresolvedVmfsResignatureSpec{ + ExtentDevicePath: devicePaths, + }, + } + + res, err := methods.ResignatureUnresolvedVmfsVolume_Task(ctx, s.Client(), req) + if err != nil { + return nil, err + } + + return NewTask(s.c, res.Returnval), nil +} diff --git a/vendor/github.com/vmware/govmomi/object/host_network_system.go b/vendor/github.com/vmware/govmomi/object/host_network_system.go index c21e1ec35d5..340b764a514 100644 --- a/vendor/github.com/vmware/govmomi/object/host_network_system.go +++ b/vendor/github.com/vmware/govmomi/object/host_network_system.go @@ -98,18 +98,18 @@ func (o HostNetworkSystem) AddVirtualSwitch(ctx context.Context, vswitchName str } // QueryNetworkHint wraps methods.QueryNetworkHint -func (o HostNetworkSystem) QueryNetworkHint(ctx context.Context, device []string) error { +func (o HostNetworkSystem) QueryNetworkHint(ctx context.Context, device []string) ([]types.PhysicalNicHintInfo, error) { req := types.QueryNetworkHint{ This: o.Reference(), Device: device, } - _, err := methods.QueryNetworkHint(ctx, o.c, &req) + res, err := methods.QueryNetworkHint(ctx, o.c, &req) if err != nil { - return err + return nil, err } - return nil + return res.Returnval, err } // RefreshNetworkSystem wraps methods.RefreshNetworkSystem diff --git a/vendor/github.com/vmware/govmomi/object/host_storage_system.go b/vendor/github.com/vmware/govmomi/object/host_storage_system.go index 5990a1d4e6b..5c9f08eee12 100644 --- a/vendor/github.com/vmware/govmomi/object/host_storage_system.go +++ b/vendor/github.com/vmware/govmomi/object/host_storage_system.go @@ -172,3 +172,29 @@ func (s HostStorageSystem) AttachScsiLun(ctx context.Context, uuid string) error return err } + +func (s HostStorageSystem) QueryUnresolvedVmfsVolumes(ctx context.Context) ([]types.HostUnresolvedVmfsVolume, error) { + req := &types.QueryUnresolvedVmfsVolume{ + This: s.Reference(), + } + + res, err := methods.QueryUnresolvedVmfsVolume(ctx, s.Client(), req) + if err != nil { + return nil, err + } + return res.Returnval, nil +} + +func (s HostStorageSystem) UnmountVmfsVolume(ctx context.Context, vmfsUuid string) error { + req := &types.UnmountVmfsVolume{ + This: s.Reference(), + VmfsUuid: vmfsUuid, + } + + _, err := methods.UnmountVmfsVolume(ctx, s.Client(), req) + if err != nil { + return err + } + + return nil +} diff --git a/vendor/github.com/vmware/govmomi/object/host_system.go b/vendor/github.com/vmware/govmomi/object/host_system.go index a350edfdebd..ddf6cb8f11a 100644 --- a/vendor/github.com/vmware/govmomi/object/host_system.go +++ b/vendor/github.com/vmware/govmomi/object/host_system.go @@ -21,6 +21,7 @@ import ( "fmt" "net" + "github.com/vmware/govmomi/internal" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" @@ -81,17 +82,17 @@ func (h HostSystem) ManagementIPs(ctx context.Context) ([]net.IP, error) { return nil, err } - var ips []net.IP - for _, nc := range mh.Config.VirtualNicManagerInfo.NetConfig { - if nc.NicType == "management" && len(nc.CandidateVnic) > 0 { - ip := net.ParseIP(nc.CandidateVnic[0].Spec.Ip.IpAddress) - if ip != nil { - ips = append(ips, ip) - } - } + config := mh.Config + if config == nil { + return nil, nil } - return ips, nil + info := config.VirtualNicManagerInfo + if info == nil { + return nil, nil + } + + return internal.HostSystemManagementIPs(info.NetConfig), nil } func (h HostSystem) Disconnect(ctx context.Context) (*Task, error) { diff --git a/vendor/github.com/vmware/govmomi/object/network.go b/vendor/github.com/vmware/govmomi/object/network.go index d1dc7ce01f6..f209a7ac4c9 100644 --- a/vendor/github.com/vmware/govmomi/object/network.go +++ b/vendor/github.com/vmware/govmomi/object/network.go @@ -20,7 +20,6 @@ import ( "context" "github.com/vmware/govmomi/vim25" - "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" ) @@ -34,21 +33,20 @@ func NewNetwork(c *vim25.Client, ref types.ManagedObjectReference) *Network { } } +func (n Network) GetInventoryPath() string { + return n.InventoryPath +} + // EthernetCardBackingInfo returns the VirtualDeviceBackingInfo for this Network func (n Network) EthernetCardBackingInfo(ctx context.Context) (types.BaseVirtualDeviceBackingInfo, error) { - var e mo.Network - - // Use Network.Name rather than Common.Name as the latter does not return the complete name if it contains a '/' - // We can't use Common.ObjectName here either as we need the ManagedEntity.Name field is not set since mo.Network - // has its own Name field. - err := n.Properties(ctx, n.Reference(), []string{"name"}, &e) + name, err := n.ObjectName(ctx) if err != nil { return nil, err } backing := &types.VirtualEthernetCardNetworkBackingInfo{ VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ - DeviceName: e.Name, + DeviceName: name, }, } diff --git a/vendor/github.com/vmware/govmomi/object/network_reference.go b/vendor/github.com/vmware/govmomi/object/network_reference.go index 7716bdb38fa..f1a41cd59b6 100644 --- a/vendor/github.com/vmware/govmomi/object/network_reference.go +++ b/vendor/github.com/vmware/govmomi/object/network_reference.go @@ -26,6 +26,6 @@ import ( // which can be used as the backing for a VirtualEthernetCard. type NetworkReference interface { Reference - + GetInventoryPath() string EthernetCardBackingInfo(ctx context.Context) (types.BaseVirtualDeviceBackingInfo, error) } diff --git a/vendor/github.com/vmware/govmomi/object/opaque_network.go b/vendor/github.com/vmware/govmomi/object/opaque_network.go index 47ce4cefe62..6797d325de7 100644 --- a/vendor/github.com/vmware/govmomi/object/opaque_network.go +++ b/vendor/github.com/vmware/govmomi/object/opaque_network.go @@ -35,19 +35,17 @@ func NewOpaqueNetwork(c *vim25.Client, ref types.ManagedObjectReference) *Opaque } } +func (n OpaqueNetwork) GetInventoryPath() string { + return n.InventoryPath +} + // EthernetCardBackingInfo returns the VirtualDeviceBackingInfo for this Network func (n OpaqueNetwork) EthernetCardBackingInfo(ctx context.Context) (types.BaseVirtualDeviceBackingInfo, error) { - var net mo.OpaqueNetwork - - if err := n.Properties(ctx, n.Reference(), []string{"summary"}, &net); err != nil { + summary, err := n.Summary(ctx) + if err != nil { return nil, err } - summary, ok := net.Summary.(*types.OpaqueNetworkSummary) - if !ok { - return nil, fmt.Errorf("%s unsupported network type: %T", n, net.Summary) - } - backing := &types.VirtualEthernetCardOpaqueNetworkBackingInfo{ OpaqueNetworkId: summary.OpaqueNetworkId, OpaqueNetworkType: summary.OpaqueNetworkType, @@ -55,3 +53,20 @@ func (n OpaqueNetwork) EthernetCardBackingInfo(ctx context.Context) (types.BaseV return backing, nil } + +// Summary returns the mo.OpaqueNetwork.Summary property +func (n OpaqueNetwork) Summary(ctx context.Context) (*types.OpaqueNetworkSummary, error) { + var props mo.OpaqueNetwork + + err := n.Properties(ctx, n.Reference(), []string{"summary"}, &props) + if err != nil { + return nil, err + } + + summary, ok := props.Summary.(*types.OpaqueNetworkSummary) + if !ok { + return nil, fmt.Errorf("%s unsupported network summary type: %T", n, props.Summary) + } + + return summary, nil +} diff --git a/vendor/github.com/vmware/govmomi/object/resource_pool.go b/vendor/github.com/vmware/govmomi/object/resource_pool.go index 55c2e2b2fde..e510006b400 100644 --- a/vendor/github.com/vmware/govmomi/object/resource_pool.go +++ b/vendor/github.com/vmware/govmomi/object/resource_pool.go @@ -22,6 +22,7 @@ import ( "github.com/vmware/govmomi/nfc" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" ) @@ -35,6 +36,18 @@ func NewResourcePool(c *vim25.Client, ref types.ManagedObjectReference) *Resourc } } +// Owner returns the ResourcePool owner as a ClusterComputeResource or ComputeResource. +func (p ResourcePool) Owner(ctx context.Context) (Reference, error) { + var pool mo.ResourcePool + + err := p.Properties(ctx, p.Reference(), []string{"owner"}, &pool) + if err != nil { + return nil, err + } + + return NewReference(p.Client(), pool.Owner), nil +} + func (p ResourcePool) ImportVApp(ctx context.Context, spec types.BaseImportSpec, folder *Folder, host *HostSystem) (*nfc.Lease, error) { req := types.ImportVApp{ This: p.Reference(), diff --git a/vendor/github.com/vmware/govmomi/object/search_index.go b/vendor/github.com/vmware/govmomi/object/search_index.go index 4b0a525d528..bcf5e29f271 100644 --- a/vendor/github.com/vmware/govmomi/object/search_index.go +++ b/vendor/github.com/vmware/govmomi/object/search_index.go @@ -161,3 +161,88 @@ func (s SearchIndex) FindChild(ctx context.Context, entity Reference, name strin } return NewReference(s.c, *res.Returnval), nil } + +// FindAllByDnsName finds all virtual machines or hosts by DNS name. +func (s SearchIndex) FindAllByDnsName(ctx context.Context, dc *Datacenter, dnsName string, vmSearch bool) ([]Reference, error) { + req := types.FindAllByDnsName{ + This: s.Reference(), + DnsName: dnsName, + VmSearch: vmSearch, + } + if dc != nil { + ref := dc.Reference() + req.Datacenter = &ref + } + + res, err := methods.FindAllByDnsName(ctx, s.c, &req) + if err != nil { + return nil, err + } + + if len(res.Returnval) == 0 { + return nil, nil + } + + var references []Reference + for _, returnval := range res.Returnval { + references = append(references, NewReference(s.c, returnval)) + } + return references, nil +} + +// FindAllByIp finds all virtual machines or hosts by IP address. +func (s SearchIndex) FindAllByIp(ctx context.Context, dc *Datacenter, ip string, vmSearch bool) ([]Reference, error) { + req := types.FindAllByIp{ + This: s.Reference(), + Ip: ip, + VmSearch: vmSearch, + } + if dc != nil { + ref := dc.Reference() + req.Datacenter = &ref + } + + res, err := methods.FindAllByIp(ctx, s.c, &req) + if err != nil { + return nil, err + } + + if len(res.Returnval) == 0 { + return nil, nil + } + + var references []Reference + for _, returnval := range res.Returnval { + references = append(references, NewReference(s.c, returnval)) + } + return references, nil +} + +// FindAllByUuid finds all virtual machines or hosts by UUID. +func (s SearchIndex) FindAllByUuid(ctx context.Context, dc *Datacenter, uuid string, vmSearch bool, instanceUuid *bool) ([]Reference, error) { + req := types.FindAllByUuid{ + This: s.Reference(), + Uuid: uuid, + VmSearch: vmSearch, + InstanceUuid: instanceUuid, + } + if dc != nil { + ref := dc.Reference() + req.Datacenter = &ref + } + + res, err := methods.FindAllByUuid(ctx, s.c, &req) + if err != nil { + return nil, err + } + + if len(res.Returnval) == 0 { + return nil, nil + } + + var references []Reference + for _, returnval := range res.Returnval { + references = append(references, NewReference(s.c, returnval)) + } + return references, nil +} diff --git a/vendor/github.com/vmware/govmomi/object/task.go b/vendor/github.com/vmware/govmomi/object/task.go index 2b66aa93b7f..088dd7f56be 100644 --- a/vendor/github.com/vmware/govmomi/object/task.go +++ b/vendor/github.com/vmware/govmomi/object/task.go @@ -48,9 +48,13 @@ func (t *Task) Wait(ctx context.Context) error { return err } -func (t *Task) WaitForResult(ctx context.Context, s progress.Sinker) (*types.TaskInfo, error) { +func (t *Task) WaitForResult(ctx context.Context, s ...progress.Sinker) (*types.TaskInfo, error) { + var pr progress.Sinker + if len(s) == 1 { + pr = s[0] + } p := property.DefaultCollector(t.c) - return task.Wait(ctx, t.Reference(), p, s) + return task.Wait(ctx, t.Reference(), p, pr) } func (t *Task) Cancel(ctx context.Context) error { @@ -60,3 +64,37 @@ func (t *Task) Cancel(ctx context.Context) error { return err } + +// SetState sets task state and optionally sets results or fault, as appropriate for state. +func (t *Task) SetState(ctx context.Context, state types.TaskInfoState, result types.AnyType, fault *types.LocalizedMethodFault) error { + req := types.SetTaskState{ + This: t.Reference(), + State: state, + Result: result, + Fault: fault, + } + _, err := methods.SetTaskState(ctx, t.Common.Client(), &req) + return err +} + +// SetDescription updates task description to describe the current phase of the task. +func (t *Task) SetDescription(ctx context.Context, description types.LocalizableMessage) error { + req := types.SetTaskDescription{ + This: t.Reference(), + Description: description, + } + _, err := methods.SetTaskDescription(ctx, t.Common.Client(), &req) + return err +} + +// UpdateProgress Sets percentage done for this task and recalculates overall percentage done. +// If a percentDone value of less than zero or greater than 100 is specified, +// a value of zero or 100 respectively is used. +func (t *Task) UpdateProgress(ctx context.Context, percentDone int) error { + req := types.UpdateProgress{ + This: t.Reference(), + PercentDone: int32(percentDone), + } + _, err := methods.UpdateProgress(ctx, t.Common.Client(), &req) + return err +} diff --git a/vendor/github.com/vmware/govmomi/object/tenant_manager.go b/vendor/github.com/vmware/govmomi/object/tenant_manager.go new file mode 100644 index 00000000000..4dda196e35e --- /dev/null +++ b/vendor/github.com/vmware/govmomi/object/tenant_manager.go @@ -0,0 +1,78 @@ +/* +Copyright (c) 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 object + +import ( + "context" + + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" +) + +type TenantManager struct { + Common +} + +func NewTenantManager(c *vim25.Client) *TenantManager { + t := TenantManager{ + Common: NewCommon(c, *c.ServiceContent.TenantManager), + } + + return &t +} + +func (t TenantManager) MarkServiceProviderEntities(ctx context.Context, entities []types.ManagedObjectReference) error { + req := types.MarkServiceProviderEntities{ + This: t.Reference(), + Entity: entities, + } + + _, err := methods.MarkServiceProviderEntities(ctx, t.Client(), &req) + if err != nil { + return err + } + + return nil +} + +func (t TenantManager) UnmarkServiceProviderEntities(ctx context.Context, entities []types.ManagedObjectReference) error { + req := types.UnmarkServiceProviderEntities{ + This: t.Reference(), + Entity: entities, + } + + _, err := methods.UnmarkServiceProviderEntities(ctx, t.Client(), &req) + if err != nil { + return err + } + + return nil +} + +func (t TenantManager) RetrieveServiceProviderEntities(ctx context.Context) ([]types.ManagedObjectReference, error) { + req := types.RetrieveServiceProviderEntities{ + This: t.Reference(), + } + + res, err := methods.RetrieveServiceProviderEntities(ctx, t.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} diff --git a/vendor/github.com/vmware/govmomi/object/virtual_app.go b/vendor/github.com/vmware/govmomi/object/virtual_app.go index 4811178f167..b7311b3e39d 100644 --- a/vendor/github.com/vmware/govmomi/object/virtual_app.go +++ b/vendor/github.com/vmware/govmomi/object/virtual_app.go @@ -103,3 +103,19 @@ func (p VirtualApp) Suspend(ctx context.Context) (*Task, error) { return NewTask(p.c, res.Returnval), nil } + +func (p VirtualApp) Clone(ctx context.Context, name string, target types.ManagedObjectReference, spec types.VAppCloneSpec) (*Task, error) { + req := types.CloneVApp_Task{ + This: p.Reference(), + Name: name, + Target: target, + Spec: spec, + } + + res, err := methods.CloneVApp_Task(ctx, p.c, &req) + if err != nil { + return nil, err + } + + return NewTask(p.c, res.Returnval), nil +} diff --git a/vendor/github.com/vmware/govmomi/object/virtual_device_list.go b/vendor/github.com/vmware/govmomi/object/virtual_device_list.go index e1c35eff88e..3765506532e 100644 --- a/vendor/github.com/vmware/govmomi/object/virtual_device_list.go +++ b/vendor/github.com/vmware/govmomi/object/virtual_device_list.go @@ -19,6 +19,7 @@ package object import ( "errors" "fmt" + "math/rand" "path/filepath" "reflect" "regexp" @@ -63,11 +64,12 @@ func EthernetCardTypes() VirtualDeviceList { &types.VirtualE1000e{}, &types.VirtualVmxnet2{}, &types.VirtualVmxnet3{}, + &types.VirtualVmxnet3Vrdma{}, &types.VirtualPCNet32{}, &types.VirtualSriovEthernetCard{}, }).Select(func(device types.BaseVirtualDevice) bool { c := device.(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() - c.GetVirtualDevice().Key = -1 + c.GetVirtualDevice().Key = VirtualDeviceList{}.newRandomKey() return true }) } @@ -134,6 +136,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 { @@ -146,6 +151,25 @@ func (l VirtualDeviceList) SelectByBackingInfo(backing types.BaseVirtualDeviceBa case types.BaseVirtualDeviceFileBackingInfo: b := backing.(types.BaseVirtualDeviceFileBackingInfo) return a.GetVirtualDeviceFileBackingInfo().FileName == b.GetVirtualDeviceFileBackingInfo().FileName + case *types.VirtualPCIPassthroughVmiopBackingInfo: + b := backing.(*types.VirtualPCIPassthroughVmiopBackingInfo) + return a.Vgpu == b.Vgpu + case *types.VirtualPCIPassthroughDynamicBackingInfo: + b := backing.(*types.VirtualPCIPassthroughDynamicBackingInfo) + if b.CustomLabel != "" && b.CustomLabel != a.CustomLabel { + return false + } + if len(b.AllowedDevice) == 0 { + return true + } + for _, x := range a.AllowedDevice { + for _, y := range b.AllowedDevice { + if x.DeviceId == y.DeviceId && x.VendorId == y.VendorId { + return true + } + } + } + return false default: return false } @@ -229,8 +253,10 @@ func (l VirtualDeviceList) FindSCSIController(name string) (*types.VirtualSCSICo func (l VirtualDeviceList) CreateSCSIController(name string) (types.BaseVirtualDevice, error) { ctypes := SCSIControllerTypes() - if name == "scsi" || name == "" { + if name == "" || name == "scsi" { name = ctypes.Type(ctypes[0]) + } else if name == "virtualscsi" { + name = "pvscsi" // ovf VirtualSCSI mapping } found := ctypes.Select(func(device types.BaseVirtualDevice) bool { @@ -431,10 +457,22 @@ 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 = l.newRandomKey() } } +// newRandomKey returns a random negative device key. +// The generated key can be used for devices you want to add so that it does not collide with existing ones. +func (l VirtualDeviceList) newRandomKey() int32 { + // NOTE: rand.Uint32 cannot be used here because conversion from uint32 to int32 may change the sign + key := rand.Int31() * -1 + if key == 0 { + return -1 + } + + return key +} + // CreateDisk creates a new VirtualDisk device which can be added to a VM. func (l VirtualDeviceList) CreateDisk(c types.BaseVirtualController, ds types.ManagedObjectReference, name string) *types.VirtualDisk { // If name is not specified, one will be chosen for you. @@ -862,6 +900,8 @@ func (l VirtualDeviceList) Type(device types.BaseVirtualDevice) string { return "lsilogic-sas" case *types.VirtualNVMEController: return "nvme" + case *types.VirtualPrecisionClock: + return "clock" default: return l.deviceName(device) } @@ -879,7 +919,13 @@ func (l VirtualDeviceList) Name(device types.BaseVirtualDevice) string { dtype := l.Type(device) switch dtype { case DeviceTypeEthernet: - key = fmt.Sprintf("%d", UnitNumber-7) + // Ethernet devices of UnitNumber 7-19 are non-SRIOV. Ethernet devices of + // UnitNumber 45-36 descending are SRIOV + if UnitNumber <= 45 && UnitNumber >= 36 { + key = fmt.Sprintf("sriov-%d", 45-UnitNumber) + } else { + key = fmt.Sprintf("%d", UnitNumber-7) + } case DeviceTypeDisk: key = fmt.Sprintf("%d-%d", d.ControllerKey, UnitNumber) default: @@ -907,25 +953,9 @@ func (l VirtualDeviceList) ConfigSpec(op types.VirtualDeviceConfigSpecOperation) var res []types.BaseVirtualDeviceConfigSpec for _, device := range l { config := &types.VirtualDeviceConfigSpec{ - Device: device, - Operation: op, - } - - if disk, ok := device.(*types.VirtualDisk); ok { - config.FileOperation = fop - - // Special case to attach an existing disk - if op == types.VirtualDeviceConfigSpecOperationAdd && disk.CapacityInKB == 0 { - childDisk := false - if b, ok := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo); ok { - childDisk = b.Parent != nil - } - - if !childDisk { - // Existing disk, clear file operation - config.FileOperation = "" - } - } + Device: device, + Operation: op, + FileOperation: diskFileOperation(op, fop, device), } res = append(res, config) diff --git a/vendor/github.com/vmware/govmomi/object/virtual_machine.go b/vendor/github.com/vmware/govmomi/object/virtual_machine.go index ba22e554f33..eeffc19fd3c 100644 --- a/vendor/github.com/vmware/govmomi/object/virtual_machine.go +++ b/vendor/github.com/vmware/govmomi/object/virtual_machine.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2015-2017 VMware, Inc. All Rights Reserved. +Copyright (c) 2015-2021 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,6 +22,7 @@ import ( "fmt" "net" "path" + "strings" "github.com/vmware/govmomi/nfc" "github.com/vmware/govmomi/property" @@ -33,12 +34,41 @@ import ( const ( PropRuntimePowerState = "summary.runtime.powerState" + PropConfigTemplate = "summary.config.template" ) 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), @@ -56,6 +86,17 @@ func (v VirtualMachine) PowerState(ctx context.Context) (types.VirtualMachinePow return o.Summary.Runtime.PowerState, nil } +func (v VirtualMachine) IsTemplate(ctx context.Context) (bool, error) { + var o mo.VirtualMachine + + err := v.Properties(ctx, v.Reference(), []string{PropConfigTemplate}, &o) + if err != nil { + return false, err + } + + return o.Summary.Config.Template, nil +} + func (v VirtualMachine) PowerOn(ctx context.Context) (*Task, error) { req := types.PowerOnVM_Task{ This: v.Reference(), @@ -169,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(), @@ -221,7 +276,9 @@ func (v VirtualMachine) RefreshStorageInfo(ctx context.Context) error { return err } -func (v VirtualMachine) WaitForIP(ctx context.Context) (string, error) { +// WaitForIP waits for the VM guest.ipAddress property to report an IP address. +// Waits for an IPv4 address if the v4 param is true. +func (v VirtualMachine) WaitForIP(ctx context.Context, v4 ...bool) (string, error) { var ip string p := property.DefaultCollector(v.c) @@ -238,6 +295,11 @@ func (v VirtualMachine) WaitForIP(ctx context.Context) (string, error) { } ip = c.Val.(string) + if len(v4) == 1 && v4[0] { + if net.ParseIP(ip).To4() == nil { + return false + } + } return true } @@ -272,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 } @@ -285,6 +349,10 @@ func (v VirtualMachine) WaitForNetIP(ctx context.Context, v4 bool, device ...str return true }) + if err != nil { + return nil, err + } + if len(device) != 0 { // Only wait for specific NIC(s) macs = make(map[string][]string) @@ -304,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 } @@ -391,29 +461,33 @@ func (v VirtualMachine) ResourcePool(ctx context.Context) (*ResourcePool, error) return NewResourcePool(v.c, *rp), nil } +func diskFileOperation(op types.VirtualDeviceConfigSpecOperation, fop types.VirtualDeviceConfigSpecFileOperation, device types.BaseVirtualDevice) types.VirtualDeviceConfigSpecFileOperation { + if disk, ok := device.(*types.VirtualDisk); ok { + // Special case to attach an existing disk + if op == types.VirtualDeviceConfigSpecOperationAdd && disk.CapacityInKB == 0 && disk.CapacityInBytes == 0 { + childDisk := false + if b, ok := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo); ok { + childDisk = b.Parent != nil + } + + if !childDisk { + fop = "" // existing disk + } + } + return fop + } + + return "" +} + func (v VirtualMachine) configureDevice(ctx context.Context, op types.VirtualDeviceConfigSpecOperation, fop types.VirtualDeviceConfigSpecFileOperation, devices ...types.BaseVirtualDevice) error { spec := types.VirtualMachineConfigSpec{} for _, device := range devices { config := &types.VirtualDeviceConfigSpec{ - Device: device, - Operation: op, - } - - if disk, ok := device.(*types.VirtualDisk); ok { - config.FileOperation = fop - - // Special case to attach an existing disk - if op == types.VirtualDeviceConfigSpecOperationAdd && disk.CapacityInKB == 0 { - childDisk := false - if b, ok := disk.Backing.(*types.VirtualDiskFlatVer2BackingInfo); ok { - childDisk = b.Parent != nil - } - - if !childDisk { - config.FileOperation = "" // existing disk - } - } + Device: device, + Operation: op, + FileOperation: diskFileOperation(op, fop, device), } spec.DeviceChange = append(spec.DeviceChange, config) @@ -446,6 +520,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 @@ -556,6 +665,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) @@ -569,7 +735,7 @@ func (v VirtualMachine) FindSnapshot(ctx context.Context, name string) (*types.M } if o.Snapshot == nil || len(o.Snapshot.RootSnapshotList) == 0 { - return nil, errors.New("No snapshots for this VM") + return nil, errors.New("no snapshots for this VM") } m := make(snapshotMap) @@ -832,6 +998,85 @@ 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) { + var noChange types.DiskChangeInfo + var err error + + if offset > disk.CapacityInBytes { + return noChange, fmt.Errorf("offset is greater than the disk size (%#x and %#x)", offset, disk.CapacityInBytes) + } else if offset == disk.CapacityInBytes { + return types.DiskChangeInfo{StartOffset: offset, Length: 0}, nil + } + + var b mo.VirtualMachineSnapshot + err = v.Properties(ctx, baseSnapshot.Reference(), []string{"config.hardware"}, &b) + if err != nil { + return noChange, fmt.Errorf("failed to fetch config.hardware of snapshot %s: %s", baseSnapshot, err) + } + + var changeId *string + for _, vd := range b.Config.Hardware.Device { + d := vd.GetVirtualDevice() + if d.Key != disk.Key { + continue + } + + // As per VDDK programming guide, these are the four types of disks + // that support CBT, see "Gathering Changed Block Information". + if b, ok := d.Backing.(*types.VirtualDiskFlatVer2BackingInfo); ok { + changeId = &b.ChangeId + break + } + if b, ok := d.Backing.(*types.VirtualDiskSparseVer2BackingInfo); ok { + changeId = &b.ChangeId + break + } + if b, ok := d.Backing.(*types.VirtualDiskRawDiskMappingVer1BackingInfo); ok { + changeId = &b.ChangeId + break + } + if b, ok := d.Backing.(*types.VirtualDiskRawDiskVer2BackingInfo); ok { + changeId = &b.ChangeId + break + } + + return noChange, fmt.Errorf("disk %d has backing info without .ChangeId: %t", disk.Key, d.Backing) + } + if changeId == nil || *changeId == "" { + return noChange, fmt.Errorf("CBT is not enabled on disk %d", disk.Key) + } + + req := types.QueryChangedDiskAreas{ + This: v.Reference(), + Snapshot: curSnapshot, + DeviceKey: disk.Key, + StartOffset: offset, + ChangeId: *changeId, + } + + res, err := methods.QueryChangedDiskAreas(ctx, v.Client(), &req) + if err != nil { + return noChange, err + } + + return res.Returnval, nil +} + +// ExportSnapshot exports all VMDK-files up to (but not including) a specified snapshot. This +// is useful when exporting a running VM. +func (v *VirtualMachine) ExportSnapshot(ctx context.Context, snapshot *types.ManagedObjectReference) (*nfc.Lease, error) { + req := types.ExportSnapshot{ + This: *snapshot, + } + resp, err := methods.ExportSnapshot(ctx, v.Client(), &req) + if err != nil { + return nil, err + } + return nfc.NewLease(v.c, resp.Returnval), nil } diff --git a/vendor/github.com/vmware/govmomi/object/vmware_distributed_virtual_switch.go b/vendor/github.com/vmware/govmomi/object/vmware_distributed_virtual_switch.go index f6caf987083..8eccba19b1e 100644 --- a/vendor/github.com/vmware/govmomi/object/vmware_distributed_virtual_switch.go +++ b/vendor/github.com/vmware/govmomi/object/vmware_distributed_virtual_switch.go @@ -19,3 +19,7 @@ package object type VmwareDistributedVirtualSwitch struct { DistributedVirtualSwitch } + +func (s VmwareDistributedVirtualSwitch) GetInventoryPath() string { + return s.InventoryPath +} diff --git a/vendor/github.com/vmware/govmomi/ovf/cim.go b/vendor/github.com/vmware/govmomi/ovf/cim.go new file mode 100644 index 00000000000..427699954c4 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/ovf/cim.go @@ -0,0 +1,128 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package ovf + +import ( + "github.com/vmware/govmomi/vim25/types" +) + +/* +Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_VirtualSystemSettingData.xsd +*/ + +type CIMVirtualSystemSettingData struct { + ElementName string `xml:"ElementName"` + InstanceID string `xml:"InstanceID"` + + AutomaticRecoveryAction *uint8 `xml:"AutomaticRecoveryAction"` + AutomaticShutdownAction *uint8 `xml:"AutomaticShutdownAction"` + AutomaticStartupAction *uint8 `xml:"AutomaticStartupAction"` + AutomaticStartupActionDelay *string `xml:"AutomaticStartupActionDelay>Interval"` + AutomaticStartupActionSequenceNumber *uint16 `xml:"AutomaticStartupActionSequenceNumber"` + Caption *string `xml:"Caption"` + ConfigurationDataRoot *string `xml:"ConfigurationDataRoot"` + ConfigurationFile *string `xml:"ConfigurationFile"` + ConfigurationID *string `xml:"ConfigurationID"` + CreationTime *string `xml:"CreationTime"` + Description *string `xml:"Description"` + LogDataRoot *string `xml:"LogDataRoot"` + Notes []string `xml:"Notes"` + RecoveryFile *string `xml:"RecoveryFile"` + SnapshotDataRoot *string `xml:"SnapshotDataRoot"` + SuspendDataRoot *string `xml:"SuspendDataRoot"` + SwapFileDataRoot *string `xml:"SwapFileDataRoot"` + VirtualSystemIdentifier *string `xml:"VirtualSystemIdentifier"` + VirtualSystemType *string `xml:"VirtualSystemType"` +} + +/* +Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_ResourceAllocationSettingData.xsd +*/ + +type CIMResourceAllocationSettingData struct { + ElementName string `xml:"ElementName"` + InstanceID string `xml:"InstanceID"` + + ResourceType *uint16 `xml:"ResourceType"` + OtherResourceType *string `xml:"OtherResourceType"` + ResourceSubType *string `xml:"ResourceSubType"` + + AddressOnParent *string `xml:"AddressOnParent"` + Address *string `xml:"Address"` + AllocationUnits *string `xml:"AllocationUnits"` + AutomaticAllocation *bool `xml:"AutomaticAllocation"` + AutomaticDeallocation *bool `xml:"AutomaticDeallocation"` + Caption *string `xml:"Caption"` + Connection []string `xml:"Connection"` + ConsumerVisibility *uint16 `xml:"ConsumerVisibility"` + Description *string `xml:"Description"` + HostResource []string `xml:"HostResource"` + Limit *uint64 `xml:"Limit"` + MappingBehavior *uint `xml:"MappingBehavior"` + Parent *string `xml:"Parent"` + PoolID *string `xml:"PoolID"` + Reservation *uint64 `xml:"Reservation"` + VirtualQuantity *uint `xml:"VirtualQuantity"` + VirtualQuantityUnits *string `xml:"VirtualQuantityUnits"` + Weight *uint `xml:"Weight"` +} + +/* +Source: http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2.24.0/CIM_StorageAllocationSettingData.xsd +*/ +type CIMStorageAllocationSettingData struct { + ElementName string `xml:"ElementName"` + InstanceID string `xml:"InstanceID"` + + ResourceType *uint16 `xml:"ResourceType"` + OtherResourceType *string `xml:"OtherResourceType"` + ResourceSubType *string `xml:"ResourceSubType"` + + Access *uint16 `xml:"Access"` + Address *string `xml:"Address"` + AddressOnParent *string `xml:"AddressOnParent"` + AllocationUnits *string `xml:"AllocationUnits"` + AutomaticAllocation *bool `xml:"AutomaticAllocation"` + AutomaticDeallocation *bool `xml:"AutomaticDeallocation"` + Caption *string `xml:"Caption"` + ChangeableType *uint16 `xml:"ChangeableType"` + ComponentSetting []types.AnyType `xml:"ComponentSetting"` + ConfigurationName *string `xml:"ConfigurationName"` + Connection []string `xml:"Connection"` + ConsumerVisibility *uint16 `xml:"ConsumerVisibility"` + Description *string `xml:"Description"` + Generation *uint64 `xml:"Generation"` + HostExtentName *string `xml:"HostExtentName"` + HostExtentNameFormat *uint16 `xml:"HostExtentNameFormat"` + HostExtentNameNamespace *uint16 `xml:"HostExtentNameNamespace"` + HostExtentStartingAddress *uint64 `xml:"HostExtentStartingAddress"` + HostResource []string `xml:"HostResource"` + HostResourceBlockSize *uint64 `xml:"HostResourceBlockSize"` + Limit *uint64 `xml:"Limit"` + MappingBehavior *uint `xml:"MappingBehavior"` + OtherHostExtentNameFormat *string `xml:"OtherHostExtentNameFormat"` + OtherHostExtentNameNamespace *string `xml:"OtherHostExtentNameNamespace"` + Parent *string `xml:"Parent"` + PoolID *string `xml:"PoolID"` + Reservation *uint64 `xml:"Reservation"` + SoID *string `xml:"SoID"` + SoOrgID *string `xml:"SoOrgID"` + VirtualQuantity *uint `xml:"VirtualQuantity"` + VirtualQuantityUnits *string `xml:"VirtualQuantityUnits"` + VirtualResourceBlockSize *uint64 `xml:"VirtualResourceBlockSize"` + Weight *uint `xml:"Weight"` +} diff --git a/vendor/github.com/vmware/govmomi/ovf/doc.go b/vendor/github.com/vmware/govmomi/ovf/doc.go new file mode 100644 index 00000000000..6284b1ac581 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/ovf/doc.go @@ -0,0 +1,25 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/* +Package ovf provides functionality to unmarshal and inspect the structure +of an OVF file. It is not a complete implementation of the specification and +is intended to be used to import virtual infrastructure into vSphere. + +For a complete specification of the OVF standard, refer to: +https://www.dmtf.org/sites/default/files/standards/documents/DSP0243_2.1.0.pdf +*/ +package ovf diff --git a/vendor/github.com/vmware/govmomi/ovf/env.go b/vendor/github.com/vmware/govmomi/ovf/env.go new file mode 100644 index 00000000000..3ec1b99d000 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/ovf/env.go @@ -0,0 +1,99 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package ovf + +import ( + "bytes" + "fmt" + + "github.com/vmware/govmomi/vim25/xml" +) + +const ( + ovfEnvHeader = `` + ovfEnvPlatformSection = ` + %s + %s + %s + %s + ` + ovfEnvPropertyHeader = `` + ovfEnvPropertyEntry = `` + ovfEnvPropertyFooter = `` + ovfEnvFooter = `` +) + +type Env struct { + XMLName xml.Name `xml:"http://schemas.dmtf.org/ovf/environment/1 Environment"` + ID string `xml:"id,attr"` + EsxID string `xml:"http://www.vmware.com/schema/ovfenv esxId,attr"` + + Platform *PlatformSection `xml:"PlatformSection"` + Property *PropertySection `xml:"PropertySection"` +} + +type PlatformSection struct { + Kind string `xml:"Kind"` + Version string `xml:"Version"` + Vendor string `xml:"Vendor"` + Locale string `xml:"Locale"` +} + +type PropertySection struct { + Properties []EnvProperty `xml:"Property"` +} + +type EnvProperty struct { + Key string `xml:"key,attr"` + Value string `xml:"value,attr"` +} + +// Marshal marshals Env to xml by using xml.Marshal. +func (e Env) Marshal() (string, error) { + x, err := xml.Marshal(e) + if err != nil { + return "", err + } + + return fmt.Sprintf("%s%s", xml.Header, x), nil +} + +// MarshalManual manually marshals Env to xml suitable for a vApp guest. +// It exists to overcome the lack of expressiveness in Go's XML namespaces. +func (e Env) MarshalManual() string { + var buffer bytes.Buffer + + buffer.WriteString(xml.Header) + buffer.WriteString(fmt.Sprintf(ovfEnvHeader, e.EsxID)) + buffer.WriteString(fmt.Sprintf(ovfEnvPlatformSection, e.Platform.Kind, e.Platform.Version, e.Platform.Vendor, e.Platform.Locale)) + + buffer.WriteString(fmt.Sprint(ovfEnvPropertyHeader)) + for _, p := range e.Property.Properties { + buffer.WriteString(fmt.Sprintf(ovfEnvPropertyEntry, p.Key, p.Value)) + } + buffer.WriteString(fmt.Sprint(ovfEnvPropertyFooter)) + + buffer.WriteString(fmt.Sprint(ovfEnvFooter)) + + return buffer.String() +} diff --git a/vendor/github.com/vmware/govmomi/ovf/envelope.go b/vendor/github.com/vmware/govmomi/ovf/envelope.go new file mode 100644 index 00000000000..274adb9df1e --- /dev/null +++ b/vendor/github.com/vmware/govmomi/ovf/envelope.go @@ -0,0 +1,208 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package ovf + +type Envelope struct { + References []File `xml:"References>File"` + + // Package level meta-data + Annotation *AnnotationSection `xml:"AnnotationSection"` + Product *ProductSection `xml:"ProductSection"` + Network *NetworkSection `xml:"NetworkSection"` + Disk *DiskSection `xml:"DiskSection"` + OperatingSystem *OperatingSystemSection `xml:"OperatingSystemSection"` + Eula *EulaSection `xml:"EulaSection"` + VirtualHardware *VirtualHardwareSection `xml:"VirtualHardwareSection"` + ResourceAllocation *ResourceAllocationSection `xml:"ResourceAllocationSection"` + DeploymentOption *DeploymentOptionSection `xml:"DeploymentOptionSection"` + + // Content: A VirtualSystem or a VirtualSystemCollection + VirtualSystem *VirtualSystem `xml:"VirtualSystem"` +} + +type VirtualSystem struct { + Content + + Annotation []AnnotationSection `xml:"AnnotationSection"` + Product []ProductSection `xml:"ProductSection"` + OperatingSystem []OperatingSystemSection `xml:"OperatingSystemSection"` + Eula []EulaSection `xml:"EulaSection"` + VirtualHardware []VirtualHardwareSection `xml:"VirtualHardwareSection"` +} + +type File struct { + ID string `xml:"id,attr"` + Href string `xml:"href,attr"` + Size uint `xml:"size,attr"` + Compression *string `xml:"compression,attr"` + ChunkSize *int `xml:"chunkSize,attr"` +} + +type Content struct { + ID string `xml:"id,attr"` + Info string `xml:"Info"` + Name *string `xml:"Name"` +} + +type Section struct { + Required *bool `xml:"required,attr"` + Info string `xml:"Info"` +} + +type AnnotationSection struct { + Section + + Annotation string `xml:"Annotation"` +} + +type ProductSection struct { + Section + + Class *string `xml:"class,attr"` + Instance *string `xml:"instance,attr"` + + Product string `xml:"Product"` + Vendor string `xml:"Vendor"` + Version string `xml:"Version"` + FullVersion string `xml:"FullVersion"` + ProductURL string `xml:"ProductUrl"` + VendorURL string `xml:"VendorUrl"` + AppURL string `xml:"AppUrl"` + Property []Property `xml:"Property"` +} + +type Property struct { + Key string `xml:"key,attr"` + Type string `xml:"type,attr"` + Qualifiers *string `xml:"qualifiers,attr"` + UserConfigurable *bool `xml:"userConfigurable,attr"` + Default *string `xml:"value,attr"` + Password *bool `xml:"password,attr"` + + Label *string `xml:"Label"` + Description *string `xml:"Description"` + + Values []PropertyConfigurationValue `xml:"Value"` +} + +type PropertyConfigurationValue struct { + Value string `xml:"value,attr"` + Configuration *string `xml:"configuration,attr"` +} + +type NetworkSection struct { + Section + + Networks []Network `xml:"Network"` +} + +type Network struct { + Name string `xml:"name,attr"` + + Description string `xml:"Description"` +} + +type DiskSection struct { + Section + + Disks []VirtualDiskDesc `xml:"Disk"` +} + +type VirtualDiskDesc struct { + DiskID string `xml:"diskId,attr"` + FileRef *string `xml:"fileRef,attr"` + Capacity string `xml:"capacity,attr"` + CapacityAllocationUnits *string `xml:"capacityAllocationUnits,attr"` + Format *string `xml:"format,attr"` + PopulatedSize *int `xml:"populatedSize,attr"` + ParentRef *string `xml:"parentRef,attr"` +} + +type OperatingSystemSection struct { + Section + + ID int16 `xml:"id,attr"` + Version *string `xml:"version,attr"` + OSType *string `xml:"osType,attr"` + + Description *string `xml:"Description"` +} + +type EulaSection struct { + Section + + License string `xml:"License"` +} + +type Config struct { + Required *bool `xml:"required,attr"` + Key string `xml:"key,attr"` + Value string `xml:"value,attr"` +} + +type VirtualHardwareSection struct { + Section + + ID *string `xml:"id,attr"` + Transport *string `xml:"transport,attr"` + + System *VirtualSystemSettingData `xml:"System"` + Item []ResourceAllocationSettingData `xml:"Item"` + StorageItem []StorageAllocationSettingData `xml:"StorageItem"` + Config []Config `xml:"Config"` + ExtraConfig []Config `xml:"ExtraConfig"` +} + +type VirtualSystemSettingData struct { + CIMVirtualSystemSettingData +} + +type ResourceAllocationSettingData struct { + CIMResourceAllocationSettingData + + Required *bool `xml:"required,attr"` + Configuration *string `xml:"configuration,attr"` + Bound *string `xml:"bound,attr"` +} + +type StorageAllocationSettingData struct { + CIMStorageAllocationSettingData + + Required *bool `xml:"required,attr"` + Configuration *string `xml:"configuration,attr"` + Bound *string `xml:"bound,attr"` +} + +type ResourceAllocationSection struct { + Section + + Item []ResourceAllocationSettingData `xml:"Item"` +} + +type DeploymentOptionSection struct { + Section + + Configuration []DeploymentOptionConfiguration `xml:"Configuration"` +} + +type DeploymentOptionConfiguration struct { + ID string `xml:"id,attr"` + Default *bool `xml:"default,attr"` + + Label string `xml:"Label"` + Description string `xml:"Description"` +} diff --git a/vendor/github.com/vmware/govmomi/ovf/manager.go b/vendor/github.com/vmware/govmomi/ovf/manager.go new file mode 100644 index 00000000000..3ee2afdd46a --- /dev/null +++ b/vendor/github.com/vmware/govmomi/ovf/manager.go @@ -0,0 +1,103 @@ +/* +Copyright (c) 2015-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 ovf + +import ( + "context" + + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +type Manager struct { + types.ManagedObjectReference + + c *vim25.Client +} + +func NewManager(c *vim25.Client) *Manager { + return &Manager{*c.ServiceContent.OvfManager, c} +} + +// CreateDescriptor wraps methods.CreateDescriptor +func (m *Manager) CreateDescriptor(ctx context.Context, obj mo.Reference, cdp types.OvfCreateDescriptorParams) (*types.OvfCreateDescriptorResult, error) { + req := types.CreateDescriptor{ + This: m.Reference(), + Obj: obj.Reference(), + Cdp: cdp, + } + + res, err := methods.CreateDescriptor(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +// CreateImportSpec wraps methods.CreateImportSpec +func (m *Manager) CreateImportSpec(ctx context.Context, ovfDescriptor string, resourcePool mo.Reference, datastore mo.Reference, cisp types.OvfCreateImportSpecParams) (*types.OvfCreateImportSpecResult, error) { + req := types.CreateImportSpec{ + This: m.Reference(), + OvfDescriptor: ovfDescriptor, + ResourcePool: resourcePool.Reference(), + Datastore: datastore.Reference(), + Cisp: cisp, + } + + res, err := methods.CreateImportSpec(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +// ParseDescriptor wraps methods.ParseDescriptor +func (m *Manager) ParseDescriptor(ctx context.Context, ovfDescriptor string, pdp types.OvfParseDescriptorParams) (*types.OvfParseDescriptorResult, error) { + req := types.ParseDescriptor{ + This: m.Reference(), + OvfDescriptor: ovfDescriptor, + Pdp: pdp, + } + + res, err := methods.ParseDescriptor(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} + +// ValidateHost wraps methods.ValidateHost +func (m *Manager) ValidateHost(ctx context.Context, ovfDescriptor string, host mo.Reference, vhp types.OvfValidateHostParams) (*types.OvfValidateHostResult, error) { + req := types.ValidateHost{ + This: m.Reference(), + OvfDescriptor: ovfDescriptor, + Host: host.Reference(), + Vhp: vhp, + } + + res, err := methods.ValidateHost(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return &res.Returnval, nil +} diff --git a/vendor/github.com/vmware/govmomi/simulator/os_unix.go b/vendor/github.com/vmware/govmomi/ovf/ovf.go similarity index 56% rename from vendor/github.com/vmware/govmomi/simulator/os_unix.go rename to vendor/github.com/vmware/govmomi/ovf/ovf.go index 30ea88e921e..bd279e757d7 100644 --- a/vendor/github.com/vmware/govmomi/simulator/os_unix.go +++ b/vendor/github.com/vmware/govmomi/ovf/ovf.go @@ -1,7 +1,5 @@ -//+build !windows - /* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. +Copyright (c) 2015 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,23 +14,22 @@ See the License for the specific language governing permissions and limitations under the License. */ -package simulator +package ovf -import "syscall" +import ( + "io" -func (ds *Datastore) stat() error { - info := ds.Info.GetDatastoreInfo() - var stat syscall.Statfs_t + "github.com/vmware/govmomi/vim25/xml" +) - err := syscall.Statfs(info.Url, &stat) +func Unmarshal(r io.Reader) (*Envelope, error) { + var e Envelope + + dec := xml.NewDecoder(r) + err := dec.Decode(&e) if err != nil { - return err + return nil, err } - info.FreeSpace = int64(stat.Bfree * uint64(stat.Bsize)) - - ds.Summary.FreeSpace = info.FreeSpace - ds.Summary.Capacity = int64(stat.Blocks * uint64(stat.Bsize)) - - return nil + return &e, nil } diff --git a/vendor/github.com/vmware/govmomi/pbm/client.go b/vendor/github.com/vmware/govmomi/pbm/client.go index 3e799ebfb61..ba2531ec966 100644 --- a/vendor/github.com/vmware/govmomi/pbm/client.go +++ b/vendor/github.com/vmware/govmomi/pbm/client.go @@ -43,6 +43,8 @@ type Client struct { *soap.Client ServiceContent types.PbmServiceInstanceContent + + RoundTripper soap.RoundTripper } func NewClient(ctx context.Context, c *vim25.Client) (*Client, error) { @@ -57,7 +59,12 @@ func NewClient(ctx context.Context, c *vim25.Client) (*Client, error) { return nil, err } - return &Client{sc, res.Returnval}, nil + 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) { @@ -224,3 +231,57 @@ func (c *Client) ProfileIDByName(ctx context.Context, profileName string) (strin } return "", fmt.Errorf("no pbm profile found with name: %q", profileName) } + +func (c *Client) FetchCapabilityMetadata(ctx context.Context, rtype *types.PbmProfileResourceType, vendorUuid string) ([]types.PbmCapabilityMetadataPerCategory, error) { + req := types.PbmFetchCapabilityMetadata{ + This: c.ServiceContent.ProfileManager, + ResourceType: rtype, + VendorUuid: vendorUuid, + } + + res, err := methods.PbmFetchCapabilityMetadata(ctx, c, &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +func (c *Client) FetchComplianceResult(ctx context.Context, entities []types.PbmServerObjectRef) ([]types.PbmComplianceResult, error) { + req := types.PbmFetchComplianceResult{ + This: c.ServiceContent.ComplianceManager, + Entities: entities, + } + + res, err := methods.PbmFetchComplianceResult(ctx, c, &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +// GetProfileNameByID gets storage profile name by ID +func (c *Client) GetProfileNameByID(ctx context.Context, profileID string) (string, error) { + resourceType := types.PbmProfileResourceType{ + ResourceType: string(types.PbmProfileResourceTypeEnumSTORAGE), + } + category := types.PbmProfileCategoryEnumREQUIREMENT + ids, err := c.QueryProfile(ctx, resourceType, string(category)) + if err != nil { + return "", err + } + + profiles, err := c.RetrieveContent(ctx, ids) + if err != nil { + return "", err + } + + for i := range profiles { + profile := profiles[i].GetPbmProfile() + if profile.ProfileId.UniqueId == profileID { + return profile.Name, nil + } + } + return "", fmt.Errorf("no pbm profile found with id: %q", profileID) +} diff --git a/vendor/github.com/vmware/govmomi/pbm/methods/methods.go b/vendor/github.com/vmware/govmomi/pbm/methods/methods.go index 1776773061b..fa7f2b200ff 100644 --- a/vendor/github.com/vmware/govmomi/pbm/methods/methods.go +++ b/vendor/github.com/vmware/govmomi/pbm/methods/methods.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2022 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/github.com/vmware/govmomi/pbm/pbm_util.go b/vendor/github.com/vmware/govmomi/pbm/pbm_util.go index 4cc8085f344..d773b8dbb77 100644 --- a/vendor/github.com/vmware/govmomi/pbm/pbm_util.go +++ b/vendor/github.com/vmware/govmomi/pbm/pbm_util.go @@ -27,6 +27,7 @@ import ( // A struct to capture pbm create spec details. type CapabilityProfileCreateSpec struct { Name string + SubProfileName string Description string Category string CapabilityList []Capability @@ -64,6 +65,7 @@ func CreateCapabilityProfileSpec(pbmCreateSpec CapabilityProfileCreateSpec) (*ty SubProfiles: []types.PbmCapabilitySubProfile{ types.PbmCapabilitySubProfile{ Capability: capabilities, + Name: pbmCreateSpec.SubProfileName, }, }, }, diff --git a/vendor/github.com/vmware/govmomi/pbm/types/enum.go b/vendor/github.com/vmware/govmomi/pbm/types/enum.go index ddd1a5f7861..66751bb1f4d 100644 --- a/vendor/github.com/vmware/govmomi/pbm/types/enum.go +++ b/vendor/github.com/vmware/govmomi/pbm/types/enum.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2022 VMware, Inc. All 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,18 @@ import ( "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 ( @@ -104,6 +116,30 @@ func init() { types.Add("pbm:PbmComplianceStatus", reflect.TypeOf((*PbmComplianceStatus)(nil)).Elem()) } +type PbmDebugManagerKeystoreName string + +const ( + PbmDebugManagerKeystoreNameSMS = PbmDebugManagerKeystoreName("SMS") + PbmDebugManagerKeystoreNameTRUSTED_ROOTS = PbmDebugManagerKeystoreName("TRUSTED_ROOTS") +) + +func init() { + types.Add("pbm:PbmDebugManagerKeystoreName", reflect.TypeOf((*PbmDebugManagerKeystoreName)(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 ( @@ -131,12 +167,42 @@ const ( 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 PbmLoggingConfigurationComponent string + +const ( + PbmLoggingConfigurationComponentPbm = PbmLoggingConfigurationComponent("pbm") + PbmLoggingConfigurationComponentVslm = PbmLoggingConfigurationComponent("vslm") + PbmLoggingConfigurationComponentSms = PbmLoggingConfigurationComponent("sms") + PbmLoggingConfigurationComponentSpbm = PbmLoggingConfigurationComponent("spbm") + PbmLoggingConfigurationComponentSps = PbmLoggingConfigurationComponent("sps") + PbmLoggingConfigurationComponentHttpclient_header = PbmLoggingConfigurationComponent("httpclient_header") + PbmLoggingConfigurationComponentHttpclient_content = PbmLoggingConfigurationComponent("httpclient_content") + PbmLoggingConfigurationComponentVmomi = PbmLoggingConfigurationComponent("vmomi") +) + +func init() { + types.Add("pbm:PbmLoggingConfigurationComponent", reflect.TypeOf((*PbmLoggingConfigurationComponent)(nil)).Elem()) +} + +type PbmLoggingConfigurationLogLevel string + +const ( + PbmLoggingConfigurationLogLevelINFO = PbmLoggingConfigurationLogLevel("INFO") + PbmLoggingConfigurationLogLevelDEBUG = PbmLoggingConfigurationLogLevel("DEBUG") + PbmLoggingConfigurationLogLevelTRACE = PbmLoggingConfigurationLogLevel("TRACE") +) + +func init() { + types.Add("pbm:PbmLoggingConfigurationLogLevel", reflect.TypeOf((*PbmLoggingConfigurationLogLevel)(nil)).Elem()) +} + type PbmObjectType string const ( @@ -145,6 +211,8 @@ const ( PbmObjectTypeVirtualDiskId = PbmObjectType("virtualDiskId") PbmObjectTypeVirtualDiskUUID = PbmObjectType("virtualDiskUUID") PbmObjectTypeDatastore = PbmObjectType("datastore") + PbmObjectTypeVsanObjectId = PbmObjectType("vsanObjectId") + PbmObjectTypeFileShareId = PbmObjectType("fileShareId") PbmObjectTypeUnknown = PbmObjectType("unknown") ) @@ -166,6 +234,18 @@ func init() { types.Add("pbm:PbmOperation", reflect.TypeOf((*PbmOperation)(nil)).Elem()) } +type PbmPolicyAssociationVolumeAllocationType string + +const ( + PbmPolicyAssociationVolumeAllocationTypeFullyInitialized = PbmPolicyAssociationVolumeAllocationType("FullyInitialized") + PbmPolicyAssociationVolumeAllocationTypeReserveSpace = PbmPolicyAssociationVolumeAllocationType("ReserveSpace") + PbmPolicyAssociationVolumeAllocationTypeConserveSpaceWhenPossible = PbmPolicyAssociationVolumeAllocationType("ConserveSpaceWhenPossible") +) + +func init() { + types.Add("pbm:PbmPolicyAssociationVolumeAllocationType", reflect.TypeOf((*PbmPolicyAssociationVolumeAllocationType)(nil)).Elem()) +} + type PbmProfileCategoryEnum string const ( @@ -191,9 +271,10 @@ func init() { type PbmSystemCreatedProfileType string const ( - PbmSystemCreatedProfileTypeVsanDefaultProfile = PbmSystemCreatedProfileType("VsanDefaultProfile") - PbmSystemCreatedProfileTypeVVolDefaultProfile = PbmSystemCreatedProfileType("VVolDefaultProfile") - PbmSystemCreatedProfileTypePmemDefaultProfile = PbmSystemCreatedProfileType("PmemDefaultProfile") + PbmSystemCreatedProfileTypeVsanDefaultProfile = PbmSystemCreatedProfileType("VsanDefaultProfile") + PbmSystemCreatedProfileTypeVVolDefaultProfile = PbmSystemCreatedProfileType("VVolDefaultProfile") + PbmSystemCreatedProfileTypePmemDefaultProfile = PbmSystemCreatedProfileType("PmemDefaultProfile") + PbmSystemCreatedProfileTypeVsanMaxDefaultProfile = PbmSystemCreatedProfileType("VsanMaxDefaultProfile") ) func init() { diff --git a/vendor/github.com/vmware/govmomi/pbm/types/if.go b/vendor/github.com/vmware/govmomi/pbm/types/if.go index 832df5e1d52..a740a25dabe 100644 --- a/vendor/github.com/vmware/govmomi/pbm/types/if.go +++ b/vendor/github.com/vmware/govmomi/pbm/types/if.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2022 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/vendor/github.com/vmware/govmomi/pbm/types/types.go b/vendor/github.com/vmware/govmomi/pbm/types/types.go index 015482d0855..1687df447db 100644 --- a/vendor/github.com/vmware/govmomi/pbm/types/types.go +++ b/vendor/github.com/vmware/govmomi/pbm/types/types.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2022 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -909,6 +909,17 @@ func init() { types.Add("pbm:PbmFaultInvalidLoginFault", reflect.TypeOf((*PbmFaultInvalidLoginFault)(nil)).Elem()) } +type PbmFaultNoPermissionEntityPrivileges struct { + types.DynamicData + + ProfileId *PbmProfileId `xml:"profileId,omitempty"` + PrivilegeIds []string `xml:"privilegeIds,omitempty"` +} + +func init() { + types.Add("pbm:PbmFaultNoPermissionEntityPrivileges", reflect.TypeOf((*PbmFaultNoPermissionEntityPrivileges)(nil)).Elem()) +} + type PbmFaultNotFound struct { PbmFault } @@ -997,6 +1008,17 @@ type PbmFetchComplianceResultResponse struct { Returnval []PbmComplianceResult `xml:"returnval,omitempty"` } +type PbmFetchEntityHealthStatusSpec struct { + types.DynamicData + + ObjectRef PbmServerObjectRef `xml:"objectRef"` + BackingId string `xml:"backingId,omitempty"` +} + +func init() { + types.Add("pbm:PbmFetchEntityHealthStatusSpec", reflect.TypeOf((*PbmFetchEntityHealthStatusSpec)(nil)).Elem()) +} + type PbmFetchResourceType PbmFetchResourceTypeRequestType func init() { @@ -1114,6 +1136,17 @@ func init() { types.Add("pbm:PbmLineOfServiceInfo", reflect.TypeOf((*PbmLineOfServiceInfo)(nil)).Elem()) } +type PbmLoggingConfiguration struct { + types.DynamicData + + Component string `xml:"component"` + LogLevel string `xml:"logLevel"` +} + +func init() { + types.Add("pbm:PbmLoggingConfiguration", reflect.TypeOf((*PbmLoggingConfiguration)(nil)).Elem()) +} + type PbmNonExistentHubs struct { PbmFault diff --git a/vendor/github.com/vmware/govmomi/program.mk b/vendor/github.com/vmware/govmomi/program.mk index 9c6996aeab9..f24939934fe 100644 --- a/vendor/github.com/vmware/govmomi/program.mk +++ b/vendor/github.com/vmware/govmomi/program.mk @@ -1,3 +1,6 @@ +# Copyright (c) 2021 VMware, Inc. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + ifneq (,$(strip $(GOOS))) ifeq (,$(strip $(GOARCH))) GOARCH := $(shell go env | grep GOARCH | awk -F= '{print $$2}' | tr -d '"') @@ -30,7 +33,7 @@ $(PROGRAM): CGO_ENABLED=0 go build -a $(BUILD_ARGS) -o $@ install: - CGO_ENABLED=0 go install $(BUILD_ARGS) + CGO_ENABLED=0 go install -v $(BUILD_ARGS) ifneq (,$(strip $(BUILD_OS))) ifneq (,$(strip $(BUILD_ARCH))) diff --git a/vendor/github.com/vmware/govmomi/property/collector.go b/vendor/github.com/vmware/govmomi/property/collector.go index b77e6006115..8798ceacbf1 100644 --- a/vendor/github.com/vmware/govmomi/property/collector.go +++ b/vendor/github.com/vmware/govmomi/property/collector.go @@ -97,10 +97,16 @@ func (p *Collector) CreateFilter(ctx context.Context, req types.CreateFilter) er return nil } -func (p *Collector) WaitForUpdates(ctx context.Context, v string) (*types.UpdateSet, error) { +func (p *Collector) WaitForUpdates(ctx context.Context, version string, opts ...*types.WaitOptions) (*types.UpdateSet, error) { req := types.WaitForUpdatesEx{ This: p.Reference(), - Version: v, + Version: version, + } + + if len(opts) == 1 { + req.Options = opts[0] + } else if len(opts) > 1 { + panic("only one option may be specified") } res, err := methods.WaitForUpdatesEx(ctx, p.roundTripper, &req) @@ -143,7 +149,7 @@ func (p *Collector) Retrieve(ctx context.Context, objs []types.ManagedObjectRefe spec := types.PropertySpec{ Type: obj.Type, } - if ps == nil { + if len(ps) == 0 { spec.All = types.NewBool(true) } else { spec.PathSet = ps @@ -179,7 +185,7 @@ func (p *Collector) Retrieve(ctx context.Context, objs []types.ManagedObjectRefe return nil } - return mo.LoadRetrievePropertiesResponse(res, dst) + return mo.LoadObjectContent(res.Returnval, dst) } // RetrieveWithFilter populates dst as Retrieve does, but only for entities matching the given filter. diff --git a/vendor/github.com/vmware/govmomi/property/filter.go b/vendor/github.com/vmware/govmomi/property/filter.go index a4bf16d0555..2287bbfd96d 100644 --- a/vendor/github.com/vmware/govmomi/property/filter.go +++ b/vendor/github.com/vmware/govmomi/property/filter.go @@ -42,6 +42,9 @@ func (f Filter) Keys() []string { // MatchProperty returns true if a Filter entry matches the given prop. func (f Filter) MatchProperty(prop types.DynamicProperty) bool { + if prop.Val == nil { + return false + } match, ok := f[prop.Name] if !ok { return false @@ -74,7 +77,7 @@ func (f Filter) MatchProperty(prop types.DynamicProperty) bool { } // convert if we can - switch prop.Val.(type) { + switch val := prop.Val.(type) { case bool: match, _ = strconv.ParseBool(s) case int16: @@ -91,7 +94,9 @@ func (f Filter) MatchProperty(prop types.DynamicProperty) bool { case float64: match, _ = strconv.ParseFloat(s, 64) case fmt.Stringer: - prop.Val = prop.Val.(fmt.Stringer).String() + prop.Val = val.String() + case *types.CustomFieldStringValue: + prop.Val = fmt.Sprintf("%d:%s", val.Key, val.Value) default: if ptype.Kind() != reflect.String { return false @@ -125,7 +130,7 @@ func (f Filter) MatchPropertyList(props []types.DynamicProperty) bool { return len(f) == len(props) // false if a property such as VM "guest" is unset } -// MatchObjectContent returns a list of ObjectContent.Obj where the ObjectContent.PropSet matches the Filter. +// MatchObjectContent returns a list of ObjectContent.Obj where the ObjectContent.PropSet matches all properties the Filter. func (f Filter) MatchObjectContent(objects []types.ObjectContent) []types.ManagedObjectReference { var refs []types.ManagedObjectReference @@ -137,3 +142,27 @@ func (f Filter) MatchObjectContent(objects []types.ObjectContent) []types.Manage return refs } + +// MatchAnyPropertyList returns true if any given props match the Filter. +func (f Filter) MatchAnyPropertyList(props []types.DynamicProperty) bool { + for _, p := range props { + if f.MatchProperty(p) { + return true + } + } + + return false +} + +// MatchAnyObjectContent returns a list of ObjectContent.Obj where the ObjectContent.PropSet matches any property in the Filter. +func (f Filter) MatchAnyObjectContent(objects []types.ObjectContent) []types.ManagedObjectReference { + var refs []types.ManagedObjectReference + + for _, o := range objects { + if f.MatchAnyPropertyList(o.PropSet) { + refs = append(refs, o.Obj) + } + } + + return refs +} diff --git a/vendor/github.com/vmware/govmomi/property/wait.go b/vendor/github.com/vmware/govmomi/property/wait.go index f730525ca70..fbb68077119 100644 --- a/vendor/github.com/vmware/govmomi/property/wait.go +++ b/vendor/github.com/vmware/govmomi/property/wait.go @@ -20,13 +20,16 @@ import ( "context" "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/soap" "github.com/vmware/govmomi/vim25/types" ) // WaitFilter provides helpers to construct a types.CreateFilter for use with property.Wait type WaitFilter struct { types.CreateFilter - Options *types.WaitOptions + Options *types.WaitOptions + PropagateMissing bool + Truncated bool } // Add a new ObjectSpec and PropertySpec to the WaitFilter @@ -81,6 +84,8 @@ func Wait(ctx context.Context, c *Collector, obj types.ManagedObjectReference, p // The newly created collector is destroyed before this function returns (both // in case of success or error). // +// By default, ObjectUpdate.MissingSet faults are not propagated to the returned error, +// set WaitFilter.PropagateMissing=true to enable MissingSet fault propagation. func WaitForUpdates(ctx context.Context, c *Collector, filter *WaitFilter, f func([]types.ObjectUpdate) bool) error { p, err := c.Create(ctx) if err != nil { @@ -89,7 +94,9 @@ func WaitForUpdates(ctx context.Context, c *Collector, filter *WaitFilter, f fun // Attempt to destroy the collector using the background context, as the // specified context may have timed out or have been canceled. - defer p.Destroy(context.Background()) + defer func() { + _ = p.Destroy(context.Background()) + }() err = p.CreateFilter(ctx, filter.CreateFilter) if err != nil { @@ -121,8 +128,21 @@ func WaitForUpdates(ctx context.Context, c *Collector, filter *WaitFilter, f fun } req.Version = set.Version + filter.Truncated = false + if set.Truncated != nil { + filter.Truncated = *set.Truncated + } for _, fs := range set.FilterSet { + if filter.PropagateMissing { + for i := range fs.ObjectSet { + for _, p := range fs.ObjectSet[i].MissingSet { + // Same behavior as mo.ObjectContentToType() + return soap.WrapVimFault(p.Fault.Fault) + } + } + } + if f(fs.ObjectSet) { return nil } diff --git a/vendor/github.com/vmware/govmomi/session/keep_alive.go b/vendor/github.com/vmware/govmomi/session/keep_alive.go index 3b44f5ffb61..7c1bebf9134 100644 --- a/vendor/github.com/vmware/govmomi/session/keep_alive.go +++ b/vendor/github.com/vmware/govmomi/session/keep_alive.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2015 VMware, Inc. All Rights Reserved. +Copyright (c) 2015-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. @@ -17,110 +17,24 @@ limitations under the License. package session import ( - "context" - "sync" "time" - "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/session/keepalive" "github.com/vmware/govmomi/vim25/soap" ) -type keepAlive struct { - sync.Mutex - - roundTripper soap.RoundTripper - idleTime time.Duration - notifyRequest chan struct{} - notifyStop chan struct{} - notifyWaitGroup sync.WaitGroup - - // keepAlive executes a request in the background with the purpose of - // keeping the session active. The response for this request is discarded. - keepAlive func(soap.RoundTripper) error -} - -func defaultKeepAlive(roundTripper soap.RoundTripper) error { - _, _ = methods.GetCurrentTime(context.Background(), roundTripper) - return nil -} - -// KeepAlive wraps the specified soap.RoundTripper and executes a meaningless -// API request in the background after the RoundTripper has been idle for the -// specified amount of idle time. The keep alive process only starts once a -// user logs in and runs until the user logs out again. +// KeepAlive is a backward compatible wrapper around KeepAliveHandler. func KeepAlive(roundTripper soap.RoundTripper, idleTime time.Duration) soap.RoundTripper { - return KeepAliveHandler(roundTripper, idleTime, defaultKeepAlive) + return KeepAliveHandler(roundTripper, idleTime, nil) } -// KeepAliveHandler works as KeepAlive() does, but the handler param can decide how to handle errors. -// For example, if connectivity to ESX/VC is down long enough for a session to expire, a handler can choose to -// Login() on a types.NotAuthenticated error. If handler returns non-nil, the keep alive go routine will be stopped. +// KeepAliveHandler is a backward compatible wrapper around keepalive.NewHandlerSOAP. func KeepAliveHandler(roundTripper soap.RoundTripper, idleTime time.Duration, handler func(soap.RoundTripper) error) soap.RoundTripper { - k := &keepAlive{ - roundTripper: roundTripper, - idleTime: idleTime, - notifyRequest: make(chan struct{}), - } - - k.keepAlive = handler - - return k -} - -func (k *keepAlive) start() { - k.Lock() - defer k.Unlock() - - if k.notifyStop != nil { - return - } - - // This channel must be closed to terminate idle timer. - k.notifyStop = make(chan struct{}) - k.notifyWaitGroup.Add(1) - - go func() { - defer k.notifyWaitGroup.Done() - - for t := time.NewTimer(k.idleTime); ; { - select { - case <-k.notifyStop: - return - case <-k.notifyRequest: - t.Reset(k.idleTime) - case <-t.C: - if err := k.keepAlive(k.roundTripper); err != nil { - k.stop() - } - t = time.NewTimer(k.idleTime) - } + var f func() error + if handler != nil { + f = func() error { + return handler(roundTripper) } - }() -} - -func (k *keepAlive) stop() { - k.Lock() - defer k.Unlock() - - if k.notifyStop != nil { - close(k.notifyStop) - k.notifyWaitGroup.Wait() - k.notifyStop = nil } -} - -func (k *keepAlive) RoundTrip(ctx context.Context, req, res soap.HasFault) error { - err := k.roundTripper.RoundTrip(ctx, req, res) - if err != nil { - return err - } - // Start ticker on login, stop ticker on logout. - switch req.(type) { - case *methods.LoginBody, *methods.LoginExtensionByCertificateBody, *methods.LoginByTokenBody: - k.start() - case *methods.LogoutBody: - k.stop() - } - - return nil + return keepalive.NewHandlerSOAP(roundTripper, idleTime, f) } diff --git a/vendor/github.com/vmware/govmomi/session/keepalive/handler.go b/vendor/github.com/vmware/govmomi/session/keepalive/handler.go new file mode 100644 index 00000000000..3ebf046a53b --- /dev/null +++ b/vendor/github.com/vmware/govmomi/session/keepalive/handler.go @@ -0,0 +1,204 @@ +/* +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 keepalive + +import ( + "context" + "errors" + "net/http" + "sync" + "time" + + "github.com/vmware/govmomi/vapi/rest" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/soap" +) + +// handler contains the generic keep alive settings and logic +type handler struct { + mu sync.Mutex + notifyStop chan struct{} + notifyWaitGroup sync.WaitGroup + + idle time.Duration + send func() error +} + +// NewHandlerSOAP returns a soap.RoundTripper for use with a vim25.Client +// The idle time specifies the interval in between send() requests. Defaults to 10 minutes. +// The send func is used to keep a session alive. Defaults to calling vim25 GetCurrentTime(). +// The keep alive goroutine starts when a Login method is called and runs until Logout is called or send returns an error. +func NewHandlerSOAP(c soap.RoundTripper, idle time.Duration, send func() error) *HandlerSOAP { + h := &handler{ + idle: idle, + send: send, + } + + if send == nil { + h.send = func() error { + return h.keepAliveSOAP(c) + } + } + + return &HandlerSOAP{h, c} +} + +// NewHandlerREST returns an http.RoundTripper for use with a rest.Client +// The idle time specifies the interval in between send() requests. Defaults to 10 minutes. +// The send func is used to keep a session alive. Defaults to calling the rest.Client.Session() method +// The keep alive goroutine starts when a Login method is called and runs until Logout is called or send returns an error. +func NewHandlerREST(c *rest.Client, idle time.Duration, send func() error) *HandlerREST { + h := &handler{ + idle: idle, + send: send, + } + + if send == nil { + h.send = func() error { + return h.keepAliveREST(c) + } + } + + return &HandlerREST{h, c.Transport} +} + +func (h *handler) keepAliveSOAP(rt soap.RoundTripper) error { + ctx := context.Background() + _, err := methods.GetCurrentTime(ctx, rt) + return err +} + +func (h *handler) keepAliveREST(c *rest.Client) error { + ctx := context.Background() + + s, err := c.Session(ctx) + if err != nil { + return err + } + if s != nil { + return nil + } + return errors.New(http.StatusText(http.StatusUnauthorized)) +} + +// Start explicitly starts the keep alive go routine. +// For use with session cache.Client, as cached sessions may not involve Login/Logout via RoundTripper. +func (h *handler) Start() { + h.mu.Lock() + defer h.mu.Unlock() + + if h.notifyStop != nil { + return + } + + if h.idle == 0 { + h.idle = time.Minute * 10 + } + + // This channel must be closed to terminate idle timer. + h.notifyStop = make(chan struct{}) + h.notifyWaitGroup.Add(1) + + go func() { + for t := time.NewTimer(h.idle); ; { + select { + case <-h.notifyStop: + h.notifyWaitGroup.Done() + t.Stop() + return + case <-t.C: + if err := h.send(); err != nil { + h.notifyWaitGroup.Done() + h.Stop() + return + } + t.Reset(h.idle) + } + } + }() +} + +// Stop explicitly stops the keep alive go routine. +// For use with session cache.Client, as cached sessions may not involve Login/Logout via RoundTripper. +func (h *handler) Stop() { + h.mu.Lock() + defer h.mu.Unlock() + + if h.notifyStop != nil { + close(h.notifyStop) + h.notifyWaitGroup.Wait() + h.notifyStop = nil + } +} + +// HandlerSOAP is a keep alive implementation for use with vim25.Client +type HandlerSOAP struct { + *handler + + roundTripper soap.RoundTripper +} + +// RoundTrip implements soap.RoundTripper +func (h *HandlerSOAP) RoundTrip(ctx context.Context, req, res soap.HasFault) error { + // Stop ticker on logout. + switch req.(type) { + case *methods.LogoutBody: + h.Stop() + } + + err := h.roundTripper.RoundTrip(ctx, req, res) + if err != nil { + return err + } + + // Start ticker on login. + switch req.(type) { + case *methods.LoginBody, *methods.LoginExtensionByCertificateBody, *methods.LoginByTokenBody: + h.Start() + } + + return nil +} + +// HandlerREST is a keep alive implementation for use with rest.Client +type HandlerREST struct { + *handler + + roundTripper http.RoundTripper +} + +// RoundTrip implements http.RoundTripper +func (h *HandlerREST) RoundTrip(req *http.Request) (*http.Response, error) { + if req.URL.Path != "/rest/com/vmware/cis/session" { + return h.roundTripper.RoundTrip(req) + } + + if req.Method == http.MethodDelete { // Logout + h.Stop() + } + + res, err := h.roundTripper.RoundTrip(req) + if err != nil { + return res, err + } + + if req.Method == http.MethodPost { // Login + h.Start() + } + + return res, err +} diff --git a/vendor/github.com/vmware/govmomi/session/manager.go b/vendor/github.com/vmware/govmomi/session/manager.go index ad3219716a4..8689acd504a 100644 --- a/vendor/github.com/vmware/govmomi/session/manager.go +++ b/vendor/github.com/vmware/govmomi/session/manager.go @@ -18,9 +18,10 @@ package session import ( "context" - "net/http" + "io/ioutil" "net/url" "os" + "strings" "github.com/vmware/govmomi/property" "github.com/vmware/govmomi/vim25" @@ -41,6 +42,21 @@ func init() { } } +// Secret returns the contents if a file path value is given, otherwise returns value itself. +func Secret(value string) (string, error) { + if len(value) == 0 { + return value, nil + } + contents, err := ioutil.ReadFile(value) + if err != nil { + if os.IsPermission(err) { + return "", err + } + return value, nil + } + return strings.TrimSpace(string(contents)), nil +} + type Manager struct { client *vim25.Client userSession *types.UserSession @@ -107,7 +123,7 @@ func (sm *Manager) LoginExtensionByCertificate(ctx context.Context, key string) // "Post https://sdkTunnel:8089/sdk: x509: certificate is valid for $vcenter_hostname, not sdkTunnel" // The only easy way around this is to disable verification for the call to LoginExtensionByCertificate(). // TODO: find a way to avoid disabling InsecureSkipVerify. - c.Transport.(*http.Transport).TLSClientConfig.InsecureSkipVerify = true + c.DefaultTransport().TLSClientConfig.InsecureSkipVerify = true } req := types.LoginExtensionByCertificate{ @@ -265,3 +281,14 @@ func (sm *Manager) CloneSession(ctx context.Context, ticket string) error { sm.userSession = &res.Returnval return nil } + +func (sm *Manager) UpdateServiceMessage(ctx context.Context, message string) error { + req := types.UpdateServiceMessage{ + This: sm.Reference(), + Message: message, + } + + _, err := methods.UpdateServiceMessage(ctx, sm.client, &req) + + return err +} diff --git a/vendor/github.com/vmware/govmomi/simulator/authorization_manager.go b/vendor/github.com/vmware/govmomi/simulator/authorization_manager.go index 969ca36704f..924ff978fe6 100644 --- a/vendor/github.com/vmware/govmomi/simulator/authorization_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/authorization_manager.go @@ -36,11 +36,12 @@ type AuthorizationManager struct { nextID int32 } -func NewAuthorizationManager(ref types.ManagedObjectReference) object.Reference { - m := &AuthorizationManager{} - m.Self = ref - m.RoleList = make([]types.AuthorizationRole, len(esx.RoleList)) - copy(m.RoleList, esx.RoleList) +func (m *AuthorizationManager) init(r *Registry) { + if len(m.RoleList) == 0 { + m.RoleList = make([]types.AuthorizationRole, len(esx.RoleList)) + copy(m.RoleList, esx.RoleList) + } + m.permissions = make(map[types.ManagedObjectReference][]types.Permission) l := object.AuthorizationRoleList(m.RoleList) @@ -52,7 +53,7 @@ func NewAuthorizationManager(ref types.ManagedObjectReference) object.Reference m.privileges[id] = struct{}{} } - root := Map.content().RootFolder + root := r.content().RootFolder for _, u := range DefaultUserGroup { m.permissions[root] = append(m.permissions[root], types.Permission{ @@ -63,8 +64,6 @@ func NewAuthorizationManager(ref types.ManagedObjectReference) object.Reference Propagate: true, }) } - - return m } func (m *AuthorizationManager) RetrieveEntityPermissions(req *types.RetrieveEntityPermissions) soap.HasFault { @@ -149,6 +148,85 @@ func (m *AuthorizationManager) RetrieveRolePermissions(req *types.RetrieveRolePe } } +func (m *AuthorizationManager) HasPrivilegeOnEntities(req *types.HasPrivilegeOnEntities) soap.HasFault { + var p []types.EntityPrivilege + + for _, e := range req.Entity { + priv := types.EntityPrivilege{Entity: e} + + for _, id := range req.PrivId { + priv.PrivAvailability = append(priv.PrivAvailability, types.PrivilegeAvailability{ + PrivId: id, + IsGranted: true, + }) + } + + p = append(p, priv) + } + + return &methods.HasPrivilegeOnEntitiesBody{ + Res: &types.HasPrivilegeOnEntitiesResponse{ + Returnval: p, + }, + } +} + +func (m *AuthorizationManager) HasPrivilegeOnEntity(req *types.HasPrivilegeOnEntity) soap.HasFault { + p := make([]bool, len(req.PrivId)) + + for i := range req.PrivId { + p[i] = true + } + + return &methods.HasPrivilegeOnEntityBody{ + Res: &types.HasPrivilegeOnEntityResponse{ + Returnval: p, + }, + } +} + +func (m *AuthorizationManager) HasUserPrivilegeOnEntities(req *types.HasUserPrivilegeOnEntities) soap.HasFault { + var p []types.EntityPrivilege + + for _, e := range req.Entities { + priv := types.EntityPrivilege{Entity: e} + + for _, id := range req.PrivId { + priv.PrivAvailability = append(priv.PrivAvailability, types.PrivilegeAvailability{ + PrivId: id, + IsGranted: true, + }) + } + + p = append(p, priv) + } + + return &methods.HasUserPrivilegeOnEntitiesBody{ + Res: &types.HasUserPrivilegeOnEntitiesResponse{ + Returnval: p, + }, + } +} + +func (m *AuthorizationManager) FetchUserPrivilegeOnEntities(req *types.FetchUserPrivilegeOnEntities) soap.HasFault { + admin := object.AuthorizationRoleList(m.RoleList).ByName("Admin").Privilege + + var p []types.UserPrivilegeResult + + for _, e := range req.Entities { + p = append(p, types.UserPrivilegeResult{ + Entity: e, + Privileges: admin, + }) + } + + return &methods.FetchUserPrivilegeOnEntitiesBody{ + Res: &types.FetchUserPrivilegeOnEntitiesResponse{ + Returnval: p, + }, + } +} + func (m *AuthorizationManager) AddAuthorizationRole(req *types.AddAuthorizationRole) soap.HasFault { body := &methods.AddAuthorizationRoleBody{} diff --git a/vendor/github.com/vmware/govmomi/simulator/cluster_compute_resource.go b/vendor/github.com/vmware/govmomi/simulator/cluster_compute_resource.go index b465cde6cc8..12f910b2e4c 100644 --- a/vendor/github.com/vmware/govmomi/simulator/cluster_compute_resource.go +++ b/vendor/github.com/vmware/govmomi/simulator/cluster_compute_resource.go @@ -17,9 +17,13 @@ limitations under the License. package simulator import ( + "log" + "math/rand" "sync/atomic" + "time" "github.com/google/uuid" + "github.com/vmware/govmomi/simulator/esx" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" @@ -33,8 +37,8 @@ type ClusterComputeResource struct { ruleKey int32 } -func (c *ClusterComputeResource) RenameTask(req *types.Rename_Task) soap.HasFault { - return RenameTask(c, req) +func (c *ClusterComputeResource) RenameTask(ctx *Context, req *types.Rename_Task) soap.HasFault { + return RenameTask(ctx, c, req) } type addHost struct { @@ -50,17 +54,21 @@ func (add *addHost) Run(task *Task) (types.AnyType, types.BaseMethodFault) { return nil, &types.NoHost{} } - host := NewHostSystem(esx.HostSystem) - host.Summary.Config.Name = spec.HostName - host.Name = host.Summary.Config.Name - if add.req.AsConnected { - host.Runtime.ConnectionState = types.HostSystemConnectionStateConnected + cr := add.ClusterComputeResource + template := esx.HostSystem + + if h := task.ctx.Map.FindByName(spec.UserName, cr.Host); h != nil { + // "clone" an existing host from the inventory + template = h.(*HostSystem).HostSystem + template.Vm = nil } else { - host.Runtime.ConnectionState = types.HostSystemConnectionStateDisconnected + template.Network = cr.Network[:1] // VM Network } - cr := add.ClusterComputeResource - Map.PutEntity(cr, Map.NewEntity(host)) + host := NewHostSystem(template) + host.configure(spec, add.req.AsConnected) + + task.ctx.Map.PutEntity(cr, task.ctx.Map.NewEntity(host)) host.Summary.Host = &host.Self cr.Host = append(cr.Host, host.Reference()) @@ -69,10 +77,10 @@ func (add *addHost) Run(task *Task) (types.AnyType, types.BaseMethodFault) { return host.Reference(), nil } -func (c *ClusterComputeResource) AddHostTask(add *types.AddHost_Task) soap.HasFault { +func (c *ClusterComputeResource) AddHostTask(ctx *Context, add *types.AddHost_Task) soap.HasFault { return &methods.AddHost_TaskBody{ Res: &types.AddHost_TaskResponse{ - Returnval: NewTask(&addHost{c, add}).Run(), + Returnval: NewTask(&addHost{c, add}).Run(ctx), }, } } @@ -265,7 +273,53 @@ func (c *ClusterComputeResource) updateOverridesDRS(cfg *types.ClusterConfigInfo return nil } -func (c *ClusterComputeResource) ReconfigureComputeResourceTask(req *types.ReconfigureComputeResource_Task) soap.HasFault { +func (c *ClusterComputeResource) updateOverridesVmOrchestration(cfg *types.ClusterConfigInfoEx, cspec *types.ClusterConfigSpecEx) types.BaseMethodFault { + for _, spec := range cspec.VmOrchestrationSpec { + var i int + var key types.ManagedObjectReference + exists := false + + if spec.Operation == types.ArrayUpdateOperationRemove { + key = spec.RemoveKey.(types.ManagedObjectReference) + } else { + key = spec.Info.Vm + } + + for i = range cfg.VmOrchestration { + if cfg.VmOrchestration[i].Vm == key { + exists = true + break + } + } + + switch spec.Operation { + case types.ArrayUpdateOperationAdd: + if exists { + return new(types.InvalidArgument) + } + cfg.VmOrchestration = append(cfg.VmOrchestration, *spec.Info) + case types.ArrayUpdateOperationEdit: + if !exists { + return new(types.InvalidArgument) + } + if spec.Info.VmReadiness.ReadyCondition != "" { + cfg.VmOrchestration[i].VmReadiness.ReadyCondition = spec.Info.VmReadiness.ReadyCondition + } + if spec.Info.VmReadiness.PostReadyDelay != 0 { + cfg.VmOrchestration[i].VmReadiness.PostReadyDelay = spec.Info.VmReadiness.PostReadyDelay + } + case types.ArrayUpdateOperationRemove: + if !exists { + return new(types.InvalidArgument) + } + cfg.VmOrchestration = append(cfg.VmOrchestration[:i], cfg.VmOrchestration[i+1:]...) + } + } + + return nil +} + +func (c *ClusterComputeResource) ReconfigureComputeResourceTask(ctx *Context, req *types.ReconfigureComputeResource_Task) soap.HasFault { task := CreateTask(c, "reconfigureCluster", func(*Task) (types.AnyType, types.BaseMethodFault) { spec, ok := req.Spec.(*types.ClusterConfigSpecEx) if !ok { @@ -277,6 +331,7 @@ func (c *ClusterComputeResource) ReconfigureComputeResourceTask(req *types.Recon c.updateGroups, c.updateOverridesDAS, c.updateOverridesDRS, + c.updateOverridesVmOrchestration, } for _, update := range updates { @@ -290,13 +345,69 @@ func (c *ClusterComputeResource) ReconfigureComputeResourceTask(req *types.Recon return &methods.ReconfigureComputeResource_TaskBody{ Res: &types.ReconfigureComputeResource_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func CreateClusterComputeResource(f *Folder, name string, spec types.ClusterConfigSpecEx) (*ClusterComputeResource, types.BaseMethodFault) { - if e := Map.FindByName(name, f.ChildEntity); e != nil { +func (c *ClusterComputeResource) PlaceVm(ctx *Context, req *types.PlaceVm) soap.HasFault { + body := new(methods.PlaceVmBody) + + if len(c.Host) == 0 { + body.Fault_ = Fault("", new(types.InvalidState)) + return body + } + + res := types.ClusterRecommendation{ + Key: "1", + Type: "V1", + Time: time.Now(), + Rating: 1, + Reason: string(types.RecommendationReasonCodeXvmotionPlacement), + ReasonText: string(types.RecommendationReasonCodeXvmotionPlacement), + Target: &c.Self, + } + + hosts := req.PlacementSpec.Hosts + if len(hosts) == 0 { + hosts = c.Host + } + + datastores := req.PlacementSpec.Datastores + if len(datastores) == 0 { + datastores = c.Datastore + } + + spec := &types.VirtualMachineRelocateSpec{ + Datastore: &datastores[rand.Intn(len(c.Datastore))], + Host: &hosts[rand.Intn(len(c.Host))], + Pool: c.ResourcePool, + } + + switch types.PlacementSpecPlacementType(req.PlacementSpec.PlacementType) { + case types.PlacementSpecPlacementTypeClone, types.PlacementSpecPlacementTypeCreate: + res.Action = append(res.Action, &types.PlacementAction{ + Vm: req.PlacementSpec.Vm, + TargetHost: spec.Host, + RelocateSpec: spec, + }) + default: + log.Printf("unsupported placement type: %s", req.PlacementSpec.PlacementType) + body.Fault_ = Fault("", new(types.NotSupported)) + return body + } + + body.Res = &types.PlaceVmResponse{ + Returnval: types.PlacementResult{ + Recommendations: []types.ClusterRecommendation{res}, + }, + } + + return body +} + +func CreateClusterComputeResource(ctx *Context, f *Folder, name string, spec types.ClusterConfigSpecEx) (*ClusterComputeResource, types.BaseMethodFault) { + if e := ctx.Map.FindByName(name, f.ChildEntity); e != nil { return nil, &types.DuplicateName{ Name: e.Entity().Name, Object: e.Reference(), @@ -306,6 +417,7 @@ func CreateClusterComputeResource(f *Folder, name string, spec types.ClusterConf cluster := &ClusterComputeResource{} cluster.EnvironmentBrowser = newEnvironmentBrowser() cluster.Name = name + cluster.Network = ctx.Map.getEntityDatacenter(f).defaultNetwork() cluster.Summary = &types.ClusterComputeResourceSummary{ UsageSummary: new(types.ClusterUsageSummary), } @@ -317,10 +429,10 @@ func CreateClusterComputeResource(f *Folder, name string, spec types.ClusterConf config.DrsConfig.Enabled = types.NewBool(true) pool := NewResourcePool() - Map.PutEntity(cluster, Map.NewEntity(pool)) + ctx.Map.PutEntity(cluster, ctx.Map.NewEntity(pool)) cluster.ResourcePool = &pool.Self - f.putChild(cluster) + folderPutChild(ctx, &f.Folder, cluster) pool.Owner = cluster.Self return cluster, nil diff --git a/vendor/github.com/vmware/govmomi/simulator/container.go b/vendor/github.com/vmware/govmomi/simulator/container.go index 43d86d7e0a0..08f8f7ed154 100644 --- a/vendor/github.com/vmware/govmomi/simulator/container.go +++ b/vendor/github.com/vmware/govmomi/simulator/container.go @@ -17,18 +17,49 @@ limitations under the License. package simulator import ( + "archive/tar" "bytes" + "encoding/hex" "encoding/json" + "fmt" + "io" "log" + "net/http" + "os" "os/exec" + "path" + "regexp" + "strconv" "strings" + "time" + "github.com/google/uuid" + + "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/types" ) +var ( + shell = "/bin/sh" +) + +func init() { + if sh, err := exec.LookPath("bash"); err != nil { + shell = sh + } +} + // container provides methods to manage a container within a simulator VM lifecycle. type container struct { - id string + id string + name string +} + +type networkSettings struct { + Gateway string + IPAddress string + IPPrefixLen int + MacAddress string } // inspect applies container network settings to vm.Guest properties. @@ -38,11 +69,13 @@ func (c *container) inspect(vm *VirtualMachine) error { } var objects []struct { + State struct { + Running bool + Paused bool + } NetworkSettings struct { - Gateway string - IPAddress string - IPPrefixLen int - MacAddress string + networkSettings + Networks map[string]networkSettings } } @@ -59,9 +92,19 @@ func (c *container) inspect(vm *VirtualMachine) error { vm.logPrintf("%s: %s", vm.Config.Annotation, string(out)) for _, o := range objects { - s := o.NetworkSettings - if s.IPAddress == "" { - continue + s := o.NetworkSettings.networkSettings + + for _, n := range o.NetworkSettings.Networks { + s = n + break + } + + if o.State.Paused { + vm.Runtime.PowerState = types.VirtualMachinePowerStateSuspended + } else if o.State.Running { + vm.Runtime.PowerState = types.VirtualMachinePowerStatePoweredOn + } else { + vm.Runtime.PowerState = types.VirtualMachinePowerStatePoweredOff } vm.Guest.IpAddress = s.IPAddress @@ -77,8 +120,104 @@ func (c *container) inspect(vm *VirtualMachine) error { return nil } +func (c *container) prepareGuestOperation( + vm *VirtualMachine, + auth types.BaseGuestAuthentication) types.BaseMethodFault { + + if c.id == "" { + return new(types.GuestOperationsUnavailable) + } + if vm.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOn { + return &types.InvalidPowerState{ + RequestedState: types.VirtualMachinePowerStatePoweredOn, + ExistingState: vm.Runtime.PowerState, + } + } + switch creds := auth.(type) { + case *types.NamePasswordAuthentication: + if creds.Username == "" || creds.Password == "" { + return new(types.InvalidGuestLogin) + } + default: + return new(types.InvalidGuestLogin) + } + return nil +} + +var sanitizeNameRx = regexp.MustCompile(`[\(\)\s]`) + +func sanitizeName(name string) string { + return sanitizeNameRx.ReplaceAllString(name, "-") +} + +// createDMI writes BIOS UUID DMI files to a container volume +func (c *container) createDMI(vm *VirtualMachine, name string) error { + image := os.Getenv("VCSIM_BUSYBOX") + if image == "" { + image = "busybox" + } + + cmd := exec.Command("docker", "run", "--rm", "-i", "-v", name+":"+"/"+name, image, "tar", "-C", "/"+name, "-xf", "-") + stdin, err := cmd.StdinPipe() + if err != nil { + return err + } + + err = cmd.Start() + if err != nil { + return err + } + + tw := tar.NewWriter(stdin) + + dmi := []struct { + name string + val func(uuid.UUID) string + }{ + {"product_uuid", productUUID}, + {"product_serial", productSerial}, + } + + for _, file := range dmi { + val := file.val(vm.uid) + _ = tw.WriteHeader(&tar.Header{ + Name: file.name, + Size: int64(len(val) + 1), + Mode: 0444, + ModTime: time.Now(), + }) + _, _ = fmt.Fprintln(tw, val) + } + + _ = tw.Close() + _ = stdin.Close() + + if err := cmd.Wait(); err != nil { + stderr := "" + if xerr, ok := err.(*exec.ExitError); ok { + stderr = string(xerr.Stderr) + } + log.Printf("%s %s: %s %s", vm.Name, cmd.Args, err, stderr) + return err + } + + return nil +} + +var ( + toolsRunning = []types.PropertyChange{ + {Name: "guest.toolsStatus", Val: types.VirtualMachineToolsStatusToolsOk}, + {Name: "guest.toolsRunningStatus", Val: string(types.VirtualMachineToolsRunningStatusGuestToolsRunning)}, + } + + toolsNotRunning = []types.PropertyChange{ + {Name: "guest.toolsStatus", Val: types.VirtualMachineToolsStatusToolsNotRunning}, + {Name: "guest.toolsRunningStatus", Val: string(types.VirtualMachineToolsRunningStatusGuestToolsNotRunning)}, + } +) + // start runs the container if specified by the RUN.container extraConfig property. -func (c *container) start(vm *VirtualMachine) { +func (c *container) start(ctx *Context, vm *VirtualMachine) { if c.id != "" { start := "start" if vm.Runtime.PowerState == types.VirtualMachinePowerStateSuspended { @@ -88,11 +227,14 @@ func (c *container) start(vm *VirtualMachine) { err := cmd.Run() if err != nil { log.Printf("%s %s: %s", vm.Name, cmd.Args, err) + } else { + ctx.Map.Update(vm, toolsRunning) } return } var args []string + var env []string for _, opt := range vm.Config.ExtraConfig { val := opt.GetOptionValue() @@ -103,32 +245,124 @@ func (c *container) start(vm *VirtualMachine) { args = []string{run} } - break + continue + } + if strings.HasPrefix(val.Key, "guestinfo.") { + key := strings.Replace(strings.ToUpper(val.Key), ".", "_", -1) + env = append(env, "--env", fmt.Sprintf("VMX_%s=%s", key, val.Value.(string))) } } if len(args) == 0 { return } + if len(env) != 0 { + // Configure env as the data access method for cloud-init-vmware-guestinfo + env = append(env, "--env", "VMX_GUESTINFO=true") + } - args = append([]string{"run", "-d", "--name", vm.Name}, args...) - cmd := exec.Command("docker", args...) + c.name = fmt.Sprintf("vcsim-%s-%s", sanitizeName(vm.Name), vm.uid) + run := append([]string{"docker", "run", "-d", "--name", c.name}, env...) + + if err := c.createDMI(vm, c.name); err != nil { + return + } + run = append(run, "-v", fmt.Sprintf("%s:%s:ro", c.name, "/sys/class/dmi/id")) + + args = append(run, args...) + cmd := exec.Command(shell, "-c", strings.Join(args, " ")) out, err := cmd.Output() if err != nil { - log.Printf("%s %s: %s", vm.Name, cmd.Args, err) + stderr := "" + if xerr, ok := err.(*exec.ExitError); ok { + stderr = string(xerr.Stderr) + } + log.Printf("%s %s: %s %s", vm.Name, cmd.Args, err, stderr) return } + ctx.Map.Update(vm, toolsRunning) c.id = strings.TrimSpace(string(out)) vm.logPrintf("%s %s: %s", cmd.Path, cmd.Args, c.id) if err = c.inspect(vm); err != nil { log.Printf("%s inspect %s: %s", vm.Name, c.id, err) } + + // Start watching the container resource. + go c.watchContainer(vm) +} + +// watchContainer monitors the underlying container and updates the VM +// properties based on the container status. This occurs until either +// the container or the VM is removed. +func (c *container) watchContainer(vm *VirtualMachine) { + + inspectInterval := time.Duration(5 * time.Second) + if d, err := time.ParseDuration(os.Getenv("VCSIM_INSPECT_INTERVAL")); err == nil { + inspectInterval = d + } + + var ( + ctx = SpoofContext() + done = make(chan struct{}) + ticker = time.NewTicker(inspectInterval) + ) + + stopUpdatingVmFromContainer := func() { + ticker.Stop() + close(done) + } + + destroyVm := func() { + // If the container cannot be found then destroy this VM. + taskRef := vm.DestroyTask(ctx, &types.Destroy_Task{ + This: vm.Self, + }).(*methods.Destroy_TaskBody).Res.Returnval + task := ctx.Map.Get(taskRef).(*Task) + + // Wait for the task to complete and see if there is an error. + task.Wait() + if task.Info.Error != nil { + vm.logPrintf("failed to destroy vm: err=%v", *task.Info.Error) + } + } + + updateVmFromContainer := func() { + // Exit the monitor loop if the VM was removed from the API side. + if c.id == "" { + stopUpdatingVmFromContainer() + return + } + + if err := c.inspect(vm); err != nil { + // If there is an error inspecting the container because it no + // longer exists, then destroy the VM as well. Please note the + // reason this logic does not invoke stopUpdatingVmFromContainer + // is because that will be handled the next time this function + // is entered and c.id is empty. + if err, ok := err.(*exec.ExitError); ok { + if strings.Contains(string(err.Stderr), "No such object") { + destroyVm() + } + } + } + } + + // Update the VM from the container at regular intervals until the done + // channel is closed. + for { + select { + case <-ticker.C: + ctx.WithLock(vm, updateVmFromContainer) + case <-done: + return + } + } } // stop the container (if any) for the given vm. -func (c *container) stop(vm *VirtualMachine) { +func (c *container) stop(ctx *Context, vm *VirtualMachine) { if c.id == "" { return } @@ -137,11 +371,13 @@ func (c *container) stop(vm *VirtualMachine) { err := cmd.Run() if err != nil { log.Printf("%s %s: %s", vm.Name, cmd.Args, err) + } else { + ctx.Map.Update(vm, toolsNotRunning) } } // pause the container (if any) for the given vm. -func (c *container) pause(vm *VirtualMachine) { +func (c *container) pause(ctx *Context, vm *VirtualMachine) { if c.id == "" { return } @@ -150,6 +386,23 @@ func (c *container) pause(vm *VirtualMachine) { err := cmd.Run() if err != nil { log.Printf("%s %s: %s", vm.Name, cmd.Args, err) + } else { + ctx.Map.Update(vm, toolsNotRunning) + } +} + +// restart the container (if any) for the given vm. +func (c *container) restart(ctx *Context, vm *VirtualMachine) { + if c.id == "" { + return + } + + cmd := exec.Command("docker", "restart", c.id) + err := cmd.Run() + if err != nil { + log.Printf("%s %s: %s", vm.Name, cmd.Args, err) + } else { + ctx.Map.Update(vm, toolsRunning) } } @@ -159,9 +412,160 @@ func (c *container) remove(vm *VirtualMachine) { return } - cmd := exec.Command("docker", "rm", "-f", c.id) - err := cmd.Run() + args := [][]string{ + {"rm", "-v", "-f", c.id}, + {"volume", "rm", "-f", c.name}, + } + + for i := range args { + cmd := exec.Command("docker", args[i]...) + err := cmd.Run() + if err != nil { + log.Printf("%s %s: %s", vm.Name, cmd.Args, err) + } + } + + c.id = "" +} + +func (c *container) exec(ctx *Context, vm *VirtualMachine, auth types.BaseGuestAuthentication, args []string) (string, types.BaseMethodFault) { + fault := vm.run.prepareGuestOperation(vm, auth) + if fault != nil { + return "", fault + } + + args = append([]string{"exec", vm.run.id}, args...) + cmd := exec.Command("docker", args...) + + res, err := cmd.CombinedOutput() if err != nil { - log.Printf("%s %s: %s", vm.Name, cmd.Args, err) + log.Printf("%s: %s (%s)", vm.Self, cmd.Args, string(res)) + return "", new(types.GuestOperationsFault) + } + + return strings.TrimSpace(string(res)), nil +} + +// From https://docs.docker.com/engine/reference/commandline/cp/ : +// > It is not possible to copy certain system files such as resources under /proc, /sys, /dev, tmpfs, and mounts created by the user in the container. +// > However, you can still copy such files by manually running tar in docker exec. +func guestUpload(id string, file string, r *http.Request) error { + cmd := exec.Command("docker", "exec", "-i", id, "tar", "Cxf", path.Dir(file), "-") + cmd.Stderr = os.Stderr + stdin, err := cmd.StdinPipe() + if err != nil { + return err + } + if err = cmd.Start(); err != nil { + return err + } + + tw := tar.NewWriter(stdin) + _ = tw.WriteHeader(&tar.Header{ + Name: path.Base(file), + Size: r.ContentLength, + Mode: 0444, + ModTime: time.Now(), + }) + + _, _ = io.Copy(tw, r.Body) + + _ = tw.Close() + _ = stdin.Close() + _ = r.Body.Close() + + return cmd.Wait() +} + +func guestDownload(id string, file string, w http.ResponseWriter) error { + cmd := exec.Command("docker", "exec", id, "tar", "Ccf", path.Dir(file), "-", path.Base(file)) + cmd.Stderr = os.Stderr + stdout, err := cmd.StdoutPipe() + if err != nil { + return err + } + if err = cmd.Start(); err != nil { + return err + } + + tr := tar.NewReader(stdout) + header, err := tr.Next() + if err != nil { + return err + } + + w.Header().Set("Content-Length", strconv.FormatInt(header.Size, 10)) + _, _ = io.Copy(w, tr) + + return cmd.Wait() +} + +const guestPrefix = "/guestFile/" + +// ServeGuest handles container guest file upload/download +func ServeGuest(w http.ResponseWriter, r *http.Request) { + // Real vCenter form: /guestFile?id=139&token=... + // vcsim form: /guestFile/tmp/foo/bar?id=ebc8837b8cb6&token=... + + id := r.URL.Query().Get("id") + file := strings.TrimPrefix(r.URL.Path, guestPrefix[:len(guestPrefix)-1]) + var err error + + switch r.Method { + case http.MethodPut: + err = guestUpload(id, file, r) + case http.MethodGet: + err = guestDownload(id, file, w) + default: + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + + if err != nil { + log.Printf("%s %s: %s", r.Method, r.URL, err) + w.WriteHeader(http.StatusInternalServerError) } } + +// productSerial returns the uuid in /sys/class/dmi/id/product_serial format +func productSerial(id uuid.UUID) string { + var dst [len(id)*2 + len(id) - 1]byte + + j := 0 + for i := 0; i < len(id); i++ { + hex.Encode(dst[j:j+2], id[i:i+1]) + j += 3 + if j < len(dst) { + s := j - 1 + if s == len(dst)/2 { + dst[s] = '-' + } else { + dst[s] = ' ' + } + } + } + + return fmt.Sprintf("VMware-%s", string(dst[:])) +} + +// productUUID returns the uuid in /sys/class/dmi/id/product_uuid format +func productUUID(id uuid.UUID) string { + var dst [36]byte + + hex.Encode(dst[0:2], id[3:4]) + hex.Encode(dst[2:4], id[2:3]) + hex.Encode(dst[4:6], id[1:2]) + hex.Encode(dst[6:8], id[0:1]) + dst[8] = '-' + hex.Encode(dst[9:11], id[5:6]) + hex.Encode(dst[11:13], id[4:5]) + dst[13] = '-' + hex.Encode(dst[14:16], id[7:8]) + hex.Encode(dst[16:18], id[6:7]) + dst[18] = '-' + hex.Encode(dst[19:23], id[8:10]) + dst[23] = '-' + hex.Encode(dst[24:], id[10:]) + + return strings.ToUpper(string(dst[:])) +} diff --git a/vendor/github.com/vmware/govmomi/simulator/custom_fields_manager.go b/vendor/github.com/vmware/govmomi/simulator/custom_fields_manager.go index 85d216159bd..4aac583f8f2 100644 --- a/vendor/github.com/vmware/govmomi/simulator/custom_fields_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/custom_fields_manager.go @@ -17,7 +17,6 @@ limitations under the License. package simulator import ( - "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/soap" @@ -30,19 +29,13 @@ type CustomFieldsManager struct { nextKey int32 } -func NewCustomFieldsManager(ref types.ManagedObjectReference) object.Reference { - m := &CustomFieldsManager{} - m.Self = ref - return m -} - // Iterates through all entities of passed field type; // Removes found field from their custom field properties. -func entitiesFieldRemove(field types.CustomFieldDef) { - entities := Map.All(field.ManagedObjectType) +func entitiesFieldRemove(ctx *Context, field types.CustomFieldDef) { + entities := ctx.Map.All(field.ManagedObjectType) for _, e := range entities { entity := e.Entity() - Map.WithLock(entity, func() { + ctx.WithLock(entity, func() { aFields := entity.AvailableField for i, aField := range aFields { if aField.Key == field.Key { @@ -72,11 +65,11 @@ func entitiesFieldRemove(field types.CustomFieldDef) { // Iterates through all entities of passed field type; // Renames found field in entity's AvailableField property. -func entitiesFieldRename(field types.CustomFieldDef) { - entities := Map.All(field.ManagedObjectType) +func entitiesFieldRename(ctx *Context, field types.CustomFieldDef) { + entities := ctx.Map.All(field.ManagedObjectType) for _, e := range entities { entity := e.Entity() - Map.WithLock(entity, func() { + ctx.WithLock(entity, func() { aFields := entity.AvailableField for i, aField := range aFields { if aField.Key == field.Key { @@ -109,7 +102,7 @@ func (c *CustomFieldsManager) findByKey(key int32) (int, *types.CustomFieldDef) return -1, nil } -func (c *CustomFieldsManager) AddCustomFieldDef(req *types.AddCustomFieldDef) soap.HasFault { +func (c *CustomFieldsManager) AddCustomFieldDef(ctx *Context, req *types.AddCustomFieldDef) soap.HasFault { body := &methods.AddCustomFieldDefBody{} _, field := c.findByNameType(req.Name, req.MoType) @@ -130,10 +123,10 @@ func (c *CustomFieldsManager) AddCustomFieldDef(req *types.AddCustomFieldDef) so FieldInstancePrivileges: req.FieldPolicy, } - entities := Map.All(req.MoType) + entities := ctx.Map.All(req.MoType) for _, e := range entities { entity := e.Entity() - Map.WithLock(entity, func() { + ctx.WithLock(entity, func() { entity.AvailableField = append(entity.AvailableField, def) }) } @@ -147,7 +140,7 @@ func (c *CustomFieldsManager) AddCustomFieldDef(req *types.AddCustomFieldDef) so return body } -func (c *CustomFieldsManager) RemoveCustomFieldDef(req *types.RemoveCustomFieldDef) soap.HasFault { +func (c *CustomFieldsManager) RemoveCustomFieldDef(ctx *Context, req *types.RemoveCustomFieldDef) soap.HasFault { body := &methods.RemoveCustomFieldDefBody{} i, field := c.findByKey(req.Key) @@ -156,7 +149,7 @@ func (c *CustomFieldsManager) RemoveCustomFieldDef(req *types.RemoveCustomFieldD return body } - entitiesFieldRemove(*field) + entitiesFieldRemove(ctx, *field) c.Field = append(c.Field[:i], c.Field[i+1:]...) @@ -164,7 +157,7 @@ func (c *CustomFieldsManager) RemoveCustomFieldDef(req *types.RemoveCustomFieldD return body } -func (c *CustomFieldsManager) RenameCustomFieldDef(req *types.RenameCustomFieldDef) soap.HasFault { +func (c *CustomFieldsManager) RenameCustomFieldDef(ctx *Context, req *types.RenameCustomFieldDef) soap.HasFault { body := &methods.RenameCustomFieldDefBody{} _, field := c.findByKey(req.Key) @@ -175,7 +168,7 @@ func (c *CustomFieldsManager) RenameCustomFieldDef(req *types.RenameCustomFieldD field.Name = req.Name - entitiesFieldRename(*field) + entitiesFieldRename(ctx, *field) body.Res = &types.RenameCustomFieldDefResponse{} return body @@ -195,8 +188,30 @@ func (c *CustomFieldsManager) SetField(ctx *Context, req *types.SetField) soap.H Value: req.Value, } - entity := Map.Get(req.Entity).(mo.Entity).Entity() + removeIndex := func(s []types.BaseCustomFieldValue, i int) []types.BaseCustomFieldValue { + new := make([]types.BaseCustomFieldValue, 0) + new = append(new, s[:i]...) + return append(new, s[i+1:]...) + } + + removeExistingValues := func(s []types.BaseCustomFieldValue) []types.BaseCustomFieldValue { + for i := 0; i < len(s); { + if s[i].GetCustomFieldValue().Key == newValue.GetCustomFieldValue().Key { + s = removeIndex(s, i) + } + i++ + } + return s + } + + entity := ctx.Map.Get(req.Entity).(mo.Entity).Entity() + ctx.WithLock(entity, func() { + // Check if custom value and value are already set. If so, remove them. + entity.CustomValue = removeExistingValues(entity.CustomValue) + entity.Value = removeExistingValues(entity.Value) + + // Add the new value entity.CustomValue = append(entity.CustomValue, newValue) entity.Value = append(entity.Value, newValue) }) diff --git a/vendor/github.com/vmware/govmomi/simulator/customization_spec_manager.go b/vendor/github.com/vmware/govmomi/simulator/customization_spec_manager.go new file mode 100644 index 00000000000..b522680e5a6 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/simulator/customization_spec_manager.go @@ -0,0 +1,349 @@ +/* +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 simulator + +import ( + "fmt" + "sync/atomic" + "time" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +var DefaultCustomizationSpec = []types.CustomizationSpecItem{ + { + Info: types.CustomizationSpecInfo{ + Name: "vcsim-linux", + Description: "", + Type: "Linux", + ChangeVersion: "1569965707", + LastUpdateTime: types.NewTime(time.Now()), + }, + Spec: types.CustomizationSpec{ + Options: &types.CustomizationLinuxOptions{}, + Identity: &types.CustomizationLinuxPrep{ + CustomizationIdentitySettings: types.CustomizationIdentitySettings{}, + HostName: &types.CustomizationVirtualMachineName{}, + Domain: "eng.vmware.com", + TimeZone: "Pacific/Apia", + HwClockUTC: types.NewBool(true), + }, + GlobalIPSettings: types.CustomizationGlobalIPSettings{ + DnsSuffixList: nil, + DnsServerList: []string{"127.0.1.1"}, + }, + NicSettingMap: []types.CustomizationAdapterMapping{ + { + MacAddress: "", + Adapter: types.CustomizationIPSettings{ + Ip: &types.CustomizationDhcpIpGenerator{}, + SubnetMask: "", + Gateway: nil, + IpV6Spec: (*types.CustomizationIPSettingsIpV6AddressSpec)(nil), + DnsServerList: nil, + DnsDomain: "", + PrimaryWINS: "", + SecondaryWINS: "", + NetBIOS: "", + }, + }, + }, + EncryptionKey: nil, + }, + }, + { + Info: types.CustomizationSpecInfo{ + Name: "vcsim-linux-static", + Description: "", + Type: "Linux", + ChangeVersion: "1569969598", + LastUpdateTime: types.NewTime(time.Now()), + }, + Spec: types.CustomizationSpec{ + Options: &types.CustomizationLinuxOptions{}, + Identity: &types.CustomizationLinuxPrep{ + CustomizationIdentitySettings: types.CustomizationIdentitySettings{}, + HostName: &types.CustomizationPrefixName{ + CustomizationName: types.CustomizationName{}, + Base: "vcsim", + }, + Domain: "eng.vmware.com", + TimeZone: "Africa/Cairo", + HwClockUTC: types.NewBool(true), + }, + GlobalIPSettings: types.CustomizationGlobalIPSettings{ + DnsSuffixList: nil, + DnsServerList: []string{"127.0.1.1"}, + }, + NicSettingMap: []types.CustomizationAdapterMapping{ + { + MacAddress: "", + Adapter: types.CustomizationIPSettings{ + Ip: &types.CustomizationUnknownIpGenerator{}, + SubnetMask: "255.255.255.0", + Gateway: []string{"10.0.0.1"}, + IpV6Spec: (*types.CustomizationIPSettingsIpV6AddressSpec)(nil), + DnsServerList: nil, + DnsDomain: "", + PrimaryWINS: "", + SecondaryWINS: "", + NetBIOS: "", + }, + }, + }, + EncryptionKey: nil, + }, + }, + { + Info: types.CustomizationSpecInfo{ + Name: "vcsim-windows-static", + Description: "", + Type: "Windows", + ChangeVersion: "1569978029", + LastUpdateTime: types.NewTime(time.Now()), + }, + Spec: types.CustomizationSpec{ + Options: &types.CustomizationWinOptions{ + CustomizationOptions: types.CustomizationOptions{}, + ChangeSID: true, + DeleteAccounts: false, + Reboot: "", + }, + Identity: &types.CustomizationSysprep{ + CustomizationIdentitySettings: types.CustomizationIdentitySettings{}, + GuiUnattended: types.CustomizationGuiUnattended{ + Password: (*types.CustomizationPassword)(nil), + TimeZone: 2, + AutoLogon: false, + AutoLogonCount: 1, + }, + UserData: types.CustomizationUserData{ + FullName: "vcsim", + OrgName: "VMware", + ComputerName: &types.CustomizationVirtualMachineName{}, + ProductId: "", + }, + GuiRunOnce: (*types.CustomizationGuiRunOnce)(nil), + Identification: types.CustomizationIdentification{ + JoinWorkgroup: "WORKGROUP", + JoinDomain: "", + DomainAdmin: "", + DomainAdminPassword: (*types.CustomizationPassword)(nil), + }, + LicenseFilePrintData: &types.CustomizationLicenseFilePrintData{ + AutoMode: "perServer", + AutoUsers: 5, + }, + }, + GlobalIPSettings: types.CustomizationGlobalIPSettings{}, + NicSettingMap: []types.CustomizationAdapterMapping{ + { + MacAddress: "", + Adapter: types.CustomizationIPSettings{ + Ip: &types.CustomizationUnknownIpGenerator{}, + SubnetMask: "255.255.255.0", + Gateway: []string{"10.0.0.1"}, + IpV6Spec: (*types.CustomizationIPSettingsIpV6AddressSpec)(nil), + DnsServerList: nil, + DnsDomain: "", + PrimaryWINS: "", + SecondaryWINS: "", + NetBIOS: "", + }, + }, + }, + EncryptionKey: []uint8{0x30}, + }, + }, + { + Info: types.CustomizationSpecInfo{ + Name: "vcsim-windows-domain", + Description: "", + Type: "Windows", + ChangeVersion: "1569970234", + LastUpdateTime: types.NewTime(time.Now()), + }, + Spec: types.CustomizationSpec{ + Options: &types.CustomizationWinOptions{ + CustomizationOptions: types.CustomizationOptions{}, + ChangeSID: true, + DeleteAccounts: false, + Reboot: "", + }, + Identity: &types.CustomizationSysprep{ + CustomizationIdentitySettings: types.CustomizationIdentitySettings{}, + GuiUnattended: types.CustomizationGuiUnattended{ + Password: &types.CustomizationPassword{ + Value: "3Gs...==", + PlainText: false, + }, + TimeZone: 15, + AutoLogon: false, + AutoLogonCount: 1, + }, + UserData: types.CustomizationUserData{ + FullName: "dougm", + OrgName: "VMware", + ComputerName: &types.CustomizationVirtualMachineName{}, + ProductId: "", + }, + GuiRunOnce: (*types.CustomizationGuiRunOnce)(nil), + Identification: types.CustomizationIdentification{ + JoinWorkgroup: "", + JoinDomain: "DOMAIN", + DomainAdmin: "vcsim", + DomainAdminPassword: &types.CustomizationPassword{ + Value: "H3g...==", + PlainText: false, + }, + }, + LicenseFilePrintData: &types.CustomizationLicenseFilePrintData{ + AutoMode: "perServer", + AutoUsers: 5, + }, + }, + GlobalIPSettings: types.CustomizationGlobalIPSettings{}, + NicSettingMap: []types.CustomizationAdapterMapping{ + { + MacAddress: "", + Adapter: types.CustomizationIPSettings{ + Ip: &types.CustomizationUnknownIpGenerator{}, + SubnetMask: "255.255.255.0", + Gateway: []string{"10.0.0.1"}, + IpV6Spec: (*types.CustomizationIPSettingsIpV6AddressSpec)(nil), + DnsServerList: nil, + DnsDomain: "", + PrimaryWINS: "", + SecondaryWINS: "", + NetBIOS: "", + }, + }, + }, + EncryptionKey: []uint8{0x30}, + }, + }, +} + +type CustomizationSpecManager struct { + mo.CustomizationSpecManager + + items []types.CustomizationSpecItem +} + +func (m *CustomizationSpecManager) init(r *Registry) { + m.items = DefaultCustomizationSpec +} + +var customizeNameCounter uint64 + +func customizeName(vm *VirtualMachine, base types.BaseCustomizationName) string { + n := atomic.AddUint64(&customizeNameCounter, 1) + + switch name := base.(type) { + case *types.CustomizationPrefixName: + return fmt.Sprintf("%s-%d", name.Base, n) + case *types.CustomizationCustomName: + return fmt.Sprintf("%s-%d", name.Argument, n) + case *types.CustomizationFixedName: + return name.Name + case *types.CustomizationUnknownName: + return "" + case *types.CustomizationVirtualMachineName: + return fmt.Sprintf("%s-%d", vm.Name, n) + default: + return "" + } +} + +func (m *CustomizationSpecManager) DoesCustomizationSpecExist(ctx *Context, req *types.DoesCustomizationSpecExist) soap.HasFault { + exists := false + + for _, item := range m.items { + if item.Info.Name == req.Name { + exists = true + break + } + } + + return &methods.DoesCustomizationSpecExistBody{ + Res: &types.DoesCustomizationSpecExistResponse{ + Returnval: exists, + }, + } +} + +func (m *CustomizationSpecManager) GetCustomizationSpec(ctx *Context, req *types.GetCustomizationSpec) soap.HasFault { + body := new(methods.GetCustomizationSpecBody) + + for _, item := range m.items { + if item.Info.Name == req.Name { + body.Res = &types.GetCustomizationSpecResponse{ + Returnval: item, + } + return body + } + } + + body.Fault_ = Fault("", new(types.NotFound)) + + return body +} + +func (m *CustomizationSpecManager) CreateCustomizationSpec(ctx *Context, req *types.CreateCustomizationSpec) soap.HasFault { + body := new(methods.CreateCustomizationSpecBody) + + for _, item := range m.items { + if item.Info.Name == req.Item.Info.Name { + body.Fault_ = Fault("", &types.AlreadyExists{Name: req.Item.Info.Name}) + return body + } + } + + m.items = append(m.items, req.Item) + body.Res = new(types.CreateCustomizationSpecResponse) + + return body +} + +func (m *CustomizationSpecManager) OverwriteCustomizationSpec(ctx *Context, req *types.OverwriteCustomizationSpec) soap.HasFault { + body := new(methods.OverwriteCustomizationSpecBody) + + for i, item := range m.items { + if item.Info.Name == req.Item.Info.Name { + m.items[i] = req.Item + body.Res = new(types.OverwriteCustomizationSpecResponse) + return body + } + } + + body.Fault_ = Fault("", new(types.NotFound)) + + return body +} + +func (m *CustomizationSpecManager) Get() mo.Reference { + clone := *m + + for i := range clone.items { + clone.Info = append(clone.Info, clone.items[i].Info) + } + + return &clone +} diff --git a/vendor/github.com/vmware/govmomi/simulator/datacenter.go b/vendor/github.com/vmware/govmomi/simulator/datacenter.go index 968decb26cb..41fc56961e3 100644 --- a/vendor/github.com/vmware/govmomi/simulator/datacenter.go +++ b/vendor/github.com/vmware/govmomi/simulator/datacenter.go @@ -17,6 +17,7 @@ limitations under the License. package simulator import ( + "log" "strings" "github.com/vmware/govmomi/simulator/esx" @@ -33,7 +34,7 @@ type Datacenter struct { } // NewDatacenter creates a Datacenter and its child folders. -func NewDatacenter(f *Folder) *Datacenter { +func NewDatacenter(ctx *Context, f *mo.Folder) *Datacenter { dc := &Datacenter{ isESX: f.Self == esx.RootFolder.Self, } @@ -42,18 +43,22 @@ func NewDatacenter(f *Folder) *Datacenter { dc.Datacenter = esx.Datacenter } - f.putChild(dc) + folderPutChild(ctx, f, dc) - dc.createFolders() + dc.createFolders(ctx) return dc } +func (dc *Datacenter) RenameTask(ctx *Context, r *types.Rename_Task) soap.HasFault { + return RenameTask(ctx, dc, r) +} + // Create Datacenter Folders. // Every Datacenter has 4 inventory Folders: Vm, Host, Datastore and Network. // The ESX folder child types are limited to 1 type. // The VC folders have additional child types, including nested folders. -func (dc *Datacenter) createFolders() { +func (dc *Datacenter) createFolders(ctx *Context) { folders := []struct { ref *types.ManagedObjectReference name string @@ -72,10 +77,10 @@ func (dc *Datacenter) createFolders() { if dc.isESX { folder.ChildType = f.types[:1] folder.Self = *f.ref - Map.PutEntity(dc, folder) + ctx.Map.PutEntity(dc, folder) } else { folder.ChildType = f.types - e := Map.PutEntity(dc, folder) + e := ctx.Map.PutEntity(dc, folder) // propagate the generated morefs to Datacenter ref := e.Reference() @@ -84,7 +89,7 @@ func (dc *Datacenter) createFolders() { } } - net := Map.Get(dc.NetworkFolder).(*Folder) + net := ctx.Map.Get(dc.NetworkFolder).(*Folder) for _, ref := range esx.Datacenter.Network { // Add VM Network by default to each Datacenter @@ -96,10 +101,41 @@ func (dc *Datacenter) createFolders() { network.Self.Value = "" // we want a different moid per-DC } - net.putChild(network) + folderPutChild(ctx, &net.Folder, network) } } +func (dc *Datacenter) defaultNetwork() []types.ManagedObjectReference { + return dc.Network[:1] // VM Network +} + +// folder returns the Datacenter folder that can contain the given object type +func (dc *Datacenter) folder(obj mo.Entity) *mo.Folder { + folders := []types.ManagedObjectReference{ + dc.VmFolder, + dc.HostFolder, + dc.DatastoreFolder, + dc.NetworkFolder, + } + otype := getManagedObject(obj).Type() + rtype := obj.Reference().Type + + for i := range folders { + folder, _ := asFolderMO(Map.Get(folders[i])) + for _, kind := range folder.ChildType { + if rtype == kind { + return folder + } + if f, ok := otype.FieldByName(kind); ok && f.Anonymous { + return folder + } + } + } + + log.Panicf("failed to find folder for type=%s", rtype) + return nil +} + func datacenterEventArgument(obj mo.Entity) *types.DatacenterEventArgument { dc, ok := obj.(*Datacenter) if !ok { @@ -117,24 +153,46 @@ func (dc *Datacenter) PowerOnMultiVMTask(ctx *Context, req *types.PowerOnMultiVM return nil, new(types.NotImplemented) } + // Return per-VM tasks, structured as: + // thisTask.result - DC level task + // +- []Attempted + // +- subTask.result - VM level powerOn task result + // +- ... + res := types.ClusterPowerOnVmResult{} + res.Attempted = []types.ClusterAttemptedVmInfo{} + for _, ref := range req.Vm { - vm := Map.Get(ref).(*VirtualMachine) - Map.WithLock(vm, func() { - vm.PowerOnVMTask(ctx, &types.PowerOnVM_Task{}) + vm := ctx.Map.Get(ref).(*VirtualMachine) + + // This task creates multiple subtasks which violates the assumption + // of 1:1 Context:Task, which results in data races in objects + // like the Simulator.Event manager. This is the minimum context + // required for the PowerOnVMTask to complete. + taskCtx := &Context{ + Context: ctx.Context, + Session: ctx.Session, + Map: ctx.Map, + } + + // NOTE: Simulator does not actually perform any specific host-level placement + // (equivalent to vSphere DRS). + taskCtx.WithLock(vm, func() { + vmTaskBody := vm.PowerOnVMTask(taskCtx, &types.PowerOnVM_Task{}).(*methods.PowerOnVM_TaskBody) + res.Attempted = append(res.Attempted, types.ClusterAttemptedVmInfo{Vm: ref, Task: &vmTaskBody.Res.Returnval}) }) } - return nil, nil + return res, nil }) return &methods.PowerOnMultiVM_TaskBody{ Res: &types.PowerOnMultiVM_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (d *Datacenter) DestroyTask(req *types.Destroy_Task) soap.HasFault { +func (d *Datacenter) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { task := CreateTask(d, "destroy", func(t *Task) (types.AnyType, types.BaseMethodFault) { folders := []types.ManagedObjectReference{ d.VmFolder, @@ -142,19 +200,21 @@ func (d *Datacenter) DestroyTask(req *types.Destroy_Task) soap.HasFault { } for _, ref := range folders { - if len(Map.Get(ref).(*Folder).ChildEntity) != 0 { + f, _ := asFolderMO(ctx.Map.Get(ref)) + if len(f.ChildEntity) != 0 { return nil, &types.ResourceInUse{} } } - Map.Get(*d.Parent).(*Folder).removeChild(d.Self) + p, _ := asFolderMO(ctx.Map.Get(*d.Parent)) + folderRemoveChild(ctx, p, d.Self) return nil, nil }) return &methods.Destroy_TaskBody{ Res: &types.Destroy_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } diff --git a/vendor/github.com/vmware/govmomi/simulator/datastore.go b/vendor/github.com/vmware/govmomi/simulator/datastore.go index 527f85dec17..f341bdd1743 100644 --- a/vendor/github.com/vmware/govmomi/simulator/datastore.go +++ b/vendor/github.com/vmware/govmomi/simulator/datastore.go @@ -17,6 +17,10 @@ limitations under the License. package simulator import ( + "net/url" + "os" + "path" + "strings" "time" "github.com/vmware/govmomi/object" @@ -30,6 +34,32 @@ type Datastore struct { mo.Datastore } +func (ds *Datastore) eventArgument() *types.DatastoreEventArgument { + return &types.DatastoreEventArgument{ + Datastore: ds.Self, + EntityEventArgument: types.EntityEventArgument{Name: ds.Name}, + } +} + +func (ds *Datastore) model(m *Model) error { + info := ds.Info.GetDatastoreInfo() + u, _ := url.Parse(info.Url) + if u.Scheme == "ds" { + // rewrite saved vmfs path to a local temp dir + u.Path = path.Clean(u.Path) + parent := strings.ReplaceAll(path.Dir(u.Path), "/", "_") + name := strings.ReplaceAll(path.Base(u.Path), ":", "_") + + dir, err := m.createTempDir(parent, name) + if err != nil { + return err + } + + info.Url = dir + } + return nil +} + func parseDatastorePath(dsPath string) (*object.DatastorePath, types.BaseMethodFault) { var p object.DatastorePath @@ -43,7 +73,7 @@ func parseDatastorePath(dsPath string) (*object.DatastorePath, types.BaseMethodF func (ds *Datastore) RefreshDatastore(*types.RefreshDatastore) soap.HasFault { r := &methods.RefreshDatastoreBody{} - err := ds.stat() + _, err := os.Stat(ds.Info.GetDatastoreInfo().Url) if err != nil { r.Fault_ = Fault(err.Error(), &types.HostConfigFault{}) return r @@ -51,9 +81,36 @@ func (ds *Datastore) RefreshDatastore(*types.RefreshDatastore) soap.HasFault { info := ds.Info.GetDatastoreInfo() - now := time.Now() - - info.Timestamp = &now + info.Timestamp = types.NewTime(time.Now()) return r } + +func (ds *Datastore) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { + task := CreateTask(ds, "destroy", func(*Task) (types.AnyType, types.BaseMethodFault) { + if len(ds.Vm) != 0 { + return nil, &types.ResourceInUse{ + Type: ds.Self.Type, + Name: ds.Name, + } + } + + for _, mount := range ds.Host { + host := ctx.Map.Get(mount.Key).(*HostSystem) + ctx.Map.RemoveReference(ctx, host, &host.Datastore, ds.Self) + parent := hostParent(&host.HostSystem) + ctx.Map.RemoveReference(ctx, parent, &parent.Datastore, ds.Self) + } + + p, _ := asFolderMO(ctx.Map.Get(*ds.Parent)) + folderRemoveChild(ctx, p, ds.Self) + + return nil, nil + }) + + return &methods.Destroy_TaskBody{ + Res: &types.Destroy_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} diff --git a/vendor/github.com/vmware/govmomi/simulator/dvs.go b/vendor/github.com/vmware/govmomi/simulator/dvs.go index 1fc5912a8c1..ec73f06edc9 100644 --- a/vendor/github.com/vmware/govmomi/simulator/dvs.go +++ b/vendor/github.com/vmware/govmomi/simulator/dvs.go @@ -17,6 +17,12 @@ limitations under the License. package simulator import ( + "fmt" + "strconv" + "strings" + + "github.com/google/uuid" + "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/soap" @@ -25,11 +31,13 @@ import ( type DistributedVirtualSwitch struct { mo.DistributedVirtualSwitch + + types.FetchDVPortsResponse } -func (s *DistributedVirtualSwitch) AddDVPortgroupTask(c *types.AddDVPortgroup_Task) soap.HasFault { +func (s *DistributedVirtualSwitch) AddDVPortgroupTask(ctx *Context, c *types.AddDVPortgroup_Task) soap.HasFault { task := CreateTask(s, "addDVPortgroup", func(t *Task) (types.AnyType, types.BaseMethodFault) { - f := Map.getEntityParent(s, "Folder").(*Folder) + f := ctx.Map.getEntityParent(s, "Folder").(*Folder) portgroups := s.Portgroup portgroupNames := s.Summary.PortgroupName @@ -39,14 +47,26 @@ func (s *DistributedVirtualSwitch) AddDVPortgroupTask(c *types.AddDVPortgroup_Ta pg.Name = spec.Name pg.Entity().Name = pg.Name - if obj := Map.FindByName(pg.Name, f.ChildEntity); obj != nil { - return nil, &types.DuplicateName{ - Name: pg.Name, - Object: obj.Reference(), + // Standard AddDVPortgroupTask() doesn't allow duplicate names, but NSX 3.0 does create some DVPGs with the same name. + // Allow duplicate names using this prefix so we can reproduce and test this condition. + if strings.HasPrefix(pg.Name, "NSX-") || spec.BackingType == string(types.DistributedVirtualPortgroupBackingTypeNsx) { + if spec.LogicalSwitchUuid == "" { + spec.LogicalSwitchUuid = uuid.New().String() + } + if spec.SegmentId == "" { + spec.SegmentId = fmt.Sprintf("/infra/segments/vnet_%s", uuid.New().String()) + } + + } else { + if obj := ctx.Map.FindByName(pg.Name, f.ChildEntity); obj != nil { + return nil, &types.DuplicateName{ + Name: pg.Name, + Object: obj.Reference(), + } } } - f.putChild(pg) + folderPutChild(ctx, &f.Folder, pg) pg.Key = pg.Self.Value pg.Config = types.DVPortgroupConfigInfo{ @@ -64,15 +84,58 @@ func (s *DistributedVirtualSwitch) AddDVPortgroupTask(c *types.AddDVPortgroup_Ta ConfigVersion: spec.ConfigVersion, AutoExpand: spec.AutoExpand, VmVnicNetworkResourcePoolKey: spec.VmVnicNetworkResourcePoolKey, + LogicalSwitchUuid: spec.LogicalSwitchUuid, + SegmentId: spec.SegmentId, + BackingType: spec.BackingType, + } + + if pg.Config.LogicalSwitchUuid != "" { + if pg.Config.BackingType == "" { + pg.Config.BackingType = "nsx" + } } if pg.Config.DefaultPortConfig == nil { pg.Config.DefaultPortConfig = &types.VMwareDVSPortSetting{ Vlan: new(types.VmwareDistributedVirtualSwitchVlanIdSpec), + UplinkTeamingPolicy: &types.VmwareUplinkPortTeamingPolicy{ + Policy: &types.StringPolicy{ + Value: "loadbalance_srcid", + }, + ReversePolicy: &types.BoolPolicy{ + Value: types.NewBool(true), + }, + NotifySwitches: &types.BoolPolicy{ + Value: types.NewBool(true), + }, + RollingOrder: &types.BoolPolicy{ + Value: types.NewBool(true), + }, + }, } } - pg.PortKeys = []string{} + if pg.Config.Policy == nil { + pg.Config.Policy = &types.VMwareDVSPortgroupPolicy{ + DVPortgroupPolicy: types.DVPortgroupPolicy{ + BlockOverrideAllowed: true, + ShapingOverrideAllowed: false, + VendorConfigOverrideAllowed: false, + LivePortMovingAllowed: false, + PortConfigResetAtDisconnect: true, + NetworkResourcePoolOverrideAllowed: types.NewBool(false), + TrafficFilterOverrideAllowed: types.NewBool(false), + }, + VlanOverrideAllowed: false, + UplinkTeamingOverrideAllowed: false, + SecurityPolicyOverrideAllowed: false, + IpfixOverrideAllowed: types.NewBool(false), + } + } + + for i := 0; i < int(spec.NumPorts); i++ { + pg.PortKeys = append(pg.PortKeys, strconv.Itoa(i)) + } portgroups = append(portgroups, pg.Self) portgroupNames = append(portgroupNames, pg.Name) @@ -80,18 +143,18 @@ func (s *DistributedVirtualSwitch) AddDVPortgroupTask(c *types.AddDVPortgroup_Ta for _, h := range s.Summary.HostMember { pg.Host = append(pg.Host, h) - host := Map.Get(h).(*HostSystem) - Map.AppendReference(host, &host.Network, pg.Reference()) + host := ctx.Map.Get(h).(*HostSystem) + ctx.Map.AppendReference(ctx, host, &host.Network, pg.Reference()) - parent := Map.Get(*host.HostSystem.Parent) + parent := ctx.Map.Get(*host.HostSystem.Parent) computeNetworks := append(hostParent(&host.HostSystem).Network, pg.Reference()) - Map.Update(parent, []types.PropertyChange{ + ctx.Map.Update(parent, []types.PropertyChange{ {Name: "network", Val: computeNetworks}, }) } } - Map.Update(s, []types.PropertyChange{ + ctx.Map.Update(s, []types.PropertyChange{ {Name: "portgroup", Val: portgroups}, {Name: "summary.portgroupName", Val: portgroupNames}, }) @@ -101,19 +164,19 @@ func (s *DistributedVirtualSwitch) AddDVPortgroupTask(c *types.AddDVPortgroup_Ta return &methods.AddDVPortgroup_TaskBody{ Res: &types.AddDVPortgroup_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (s *DistributedVirtualSwitch) ReconfigureDvsTask(req *types.ReconfigureDvs_Task) soap.HasFault { +func (s *DistributedVirtualSwitch) ReconfigureDvsTask(ctx *Context, req *types.ReconfigureDvs_Task) soap.HasFault { task := CreateTask(s, "reconfigureDvs", func(t *Task) (types.AnyType, types.BaseMethodFault) { spec := req.Spec.GetDVSConfigSpec() members := s.Summary.HostMember for _, member := range spec.Host { - h := Map.Get(member.Host) + h := ctx.Map.Get(member.Host) if h == nil { return nil, &types.ManagedObjectNotFound{Obj: member.Host} } @@ -127,29 +190,34 @@ func (s *DistributedVirtualSwitch) ReconfigureDvsTask(req *types.ReconfigureDvs_ } hostNetworks := append(host.Network, s.Portgroup...) - Map.Update(host, []types.PropertyChange{ + ctx.Map.Update(host, []types.PropertyChange{ {Name: "network", Val: hostNetworks}, }) members = append(members, member.Host) - parent := Map.Get(*host.HostSystem.Parent) + parent := ctx.Map.Get(*host.HostSystem.Parent) var pgs []types.ManagedObjectReference for _, ref := range s.Portgroup { - pg := Map.Get(ref).(*DistributedVirtualPortgroup) + pg := ctx.Map.Get(ref).(*DistributedVirtualPortgroup) pgs = append(pgs, ref) pgHosts := append(pg.Host, member.Host) - Map.Update(pg, []types.PropertyChange{ + ctx.Map.Update(pg, []types.PropertyChange{ {Name: "host", Val: pgHosts}, }) + + cr := hostParent(&host.HostSystem) + if FindReference(cr.Network, ref) == nil { + computeNetworks := append(cr.Network, ref) + ctx.Map.Update(parent, []types.PropertyChange{ + {Name: "network", Val: computeNetworks}, + }) + } } - Map.Update(parent, []types.PropertyChange{ - {Name: "network", Val: pgs}, - }) case types.ConfigSpecOperationRemove: for _, ref := range host.Vm { - vm := Map.Get(ref).(*VirtualMachine) + vm := ctx.Map.Get(ref).(*VirtualMachine) if pg := FindReference(vm.Network, s.Portgroup...); pg != nil { return nil, &types.ResourceInUse{ Type: pg.Type, @@ -164,7 +232,7 @@ func (s *DistributedVirtualSwitch) ReconfigureDvsTask(req *types.ReconfigureDvs_ } } - Map.Update(s, []types.PropertyChange{ + ctx.Map.Update(s, []types.PropertyChange{ {Name: "summary.hostMember", Val: members}, }) @@ -173,7 +241,7 @@ func (s *DistributedVirtualSwitch) ReconfigureDvsTask(req *types.ReconfigureDvs_ return &methods.ReconfigureDvs_TaskBody{ Res: &types.ReconfigureDvs_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } @@ -186,42 +254,142 @@ func (s *DistributedVirtualSwitch) FetchDVPorts(req *types.FetchDVPorts) soap.Ha return body } -func (s *DistributedVirtualSwitch) DestroyTask(req *types.Destroy_Task) soap.HasFault { +func (s *DistributedVirtualSwitch) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { task := CreateTask(s, "destroy", func(t *Task) (types.AnyType, types.BaseMethodFault) { - f := Map.getEntityParent(s, "Folder").(*Folder) - f.removeChild(s.Reference()) + f := ctx.Map.getEntityParent(s, "Folder").(*Folder) + folderRemoveChild(ctx, &f.Folder, s.Reference()) return nil, nil }) return &methods.Destroy_TaskBody{ Res: &types.Destroy_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (s *DistributedVirtualSwitch) dvPortgroups(_ *types.DistributedVirtualSwitchPortCriteria) []types.DistributedVirtualPort { - // TODO(agui): Filter is not implemented yet - var res []types.DistributedVirtualPort +func (s *DistributedVirtualSwitch) dvPortgroups(criteria *types.DistributedVirtualSwitchPortCriteria) []types.DistributedVirtualPort { + res := s.FetchDVPortsResponse.Returnval + if len(res) != 0 { + return res + } + for _, ref := range s.Portgroup { pg := Map.Get(ref).(*DistributedVirtualPortgroup) - res = append(res, types.DistributedVirtualPort{ - DvsUuid: s.Uuid, - Key: pg.Key, - Config: types.DVPortConfigInfo{ - Setting: pg.Config.DefaultPortConfig, - }, - }) for _, key := range pg.PortKeys { res = append(res, types.DistributedVirtualPort{ - DvsUuid: s.Uuid, - Key: key, + DvsUuid: s.Uuid, + Key: key, + PortgroupKey: pg.Key, Config: types.DVPortConfigInfo{ Setting: pg.Config.DefaultPortConfig, }, }) } } + + // filter ports by criteria + res = s.filterDVPorts(res, criteria) + return res } + +func (s *DistributedVirtualSwitch) filterDVPorts( + ports []types.DistributedVirtualPort, + criteria *types.DistributedVirtualSwitchPortCriteria, +) []types.DistributedVirtualPort { + if criteria == nil { + return ports + } + + ports = s.filterDVPortsByPortgroupKey(ports, criteria) + ports = s.filterDVPortsByPortKey(ports, criteria) + ports = s.filterDVPortsByConnected(ports, criteria) + + return ports +} + +func (s *DistributedVirtualSwitch) filterDVPortsByPortgroupKey( + ports []types.DistributedVirtualPort, + criteria *types.DistributedVirtualSwitchPortCriteria, +) []types.DistributedVirtualPort { + if len(criteria.PortgroupKey) == 0 || criteria.Inside == nil { + return ports + } + + // inside portgroup keys + if *criteria.Inside { + filtered := []types.DistributedVirtualPort{} + + for _, p := range ports { + for _, pgk := range criteria.PortgroupKey { + if p.PortgroupKey == pgk { + filtered = append(filtered, p) + break + } + } + } + return filtered + } + + // outside portgroup keys + filtered := []types.DistributedVirtualPort{} + + for _, p := range ports { + found := false + for _, pgk := range criteria.PortgroupKey { + if p.PortgroupKey == pgk { + found = true + break + } + } + + if !found { + filtered = append(filtered, p) + } + } + return filtered +} + +func (s *DistributedVirtualSwitch) filterDVPortsByPortKey( + ports []types.DistributedVirtualPort, + criteria *types.DistributedVirtualSwitchPortCriteria, +) []types.DistributedVirtualPort { + if len(criteria.PortKey) == 0 { + return ports + } + + filtered := []types.DistributedVirtualPort{} + + for _, p := range ports { + for _, pk := range criteria.PortKey { + if p.Key == pk { + filtered = append(filtered, p) + break + } + } + } + + return filtered +} + +func (s *DistributedVirtualSwitch) filterDVPortsByConnected( + ports []types.DistributedVirtualPort, + criteria *types.DistributedVirtualSwitchPortCriteria, +) []types.DistributedVirtualPort { + if criteria.Connected == nil { + return ports + } + + filtered := []types.DistributedVirtualPort{} + + for _, p := range ports { + connected := p.Connectee != nil + if connected == *criteria.Connected { + filtered = append(filtered, p) + } + } + + return filtered +} diff --git a/vendor/github.com/vmware/govmomi/simulator/dvs_manager.go b/vendor/github.com/vmware/govmomi/simulator/dvs_manager.go new file mode 100644 index 00000000000..8643027c106 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/simulator/dvs_manager.go @@ -0,0 +1,51 @@ +/* + 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 simulator + +import ( + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type DistributedVirtualSwitchManager struct { + mo.DistributedVirtualSwitchManager +} + +func (m *DistributedVirtualSwitchManager) DVSManagerLookupDvPortGroup(ctx *Context, req *types.DVSManagerLookupDvPortGroup) soap.HasFault { + body := &methods.DVSManagerLookupDvPortGroupBody{} + + for _, obj := range ctx.Map.All("DistributedVirtualSwitch") { + dvs := obj.(*DistributedVirtualSwitch) + if dvs.Uuid == req.SwitchUuid { + for _, ref := range dvs.Portgroup { + pg := ctx.Map.Get(ref).(*DistributedVirtualPortgroup) + if pg.Key == req.PortgroupKey { + body.Res = &types.DVSManagerLookupDvPortGroupResponse{ + Returnval: &ref, + } + return body + } + } + } + } + + body.Fault_ = Fault("", new(types.NotFound)) + + return body +} diff --git a/vendor/github.com/vmware/govmomi/simulator/entity.go b/vendor/github.com/vmware/govmomi/simulator/entity.go index c865c9ff4cd..183e954f080 100644 --- a/vendor/github.com/vmware/govmomi/simulator/entity.go +++ b/vendor/github.com/vmware/govmomi/simulator/entity.go @@ -23,24 +23,25 @@ import ( "github.com/vmware/govmomi/vim25/types" ) -func RenameTask(e mo.Entity, r *types.Rename_Task) soap.HasFault { +func RenameTask(ctx *Context, e mo.Entity, r *types.Rename_Task, dup ...bool) soap.HasFault { task := CreateTask(e, "rename", func(t *Task) (types.AnyType, types.BaseMethodFault) { - obj := Map.Get(r.This).(mo.Entity).Entity() + obj := ctx.Map.Get(r.This).(mo.Entity).Entity() - if parent, ok := Map.Get(*obj.Parent).(*Folder); ok { - if Map.FindByName(r.NewName, parent.ChildEntity) != nil { + canDup := len(dup) == 1 && dup[0] + if parent, ok := asFolderMO(ctx.Map.Get(*obj.Parent)); ok && !canDup { + if ctx.Map.FindByName(r.NewName, parent.ChildEntity) != nil { return nil, &types.InvalidArgument{InvalidProperty: "name"} } } - Map.Update(e, []types.PropertyChange{{Name: "name", Val: r.NewName}}) + ctx.Map.Update(e, []types.PropertyChange{{Name: "name", Val: r.NewName}}) return nil, nil }) return &methods.Rename_TaskBody{ Res: &types.Rename_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } diff --git a/vendor/github.com/vmware/govmomi/simulator/environment_browser.go b/vendor/github.com/vmware/govmomi/simulator/environment_browser.go index 02057f6729d..4f8ba8ed9e6 100644 --- a/vendor/github.com/vmware/govmomi/simulator/environment_browser.go +++ b/vendor/github.com/vmware/govmomi/simulator/environment_browser.go @@ -17,6 +17,8 @@ limitations under the License. package simulator import ( + "strings" + "github.com/vmware/govmomi/simulator/esx" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" @@ -26,6 +28,8 @@ import ( type EnvironmentBrowser struct { mo.EnvironmentBrowser + + types.QueryConfigOptionResponse } func newEnvironmentBrowser() *types.ManagedObjectReference { @@ -34,12 +38,33 @@ func newEnvironmentBrowser() *types.ManagedObjectReference { return &env.Self } +func (b *EnvironmentBrowser) hosts(ctx *Context) []types.ManagedObjectReference { + ctx.Map.m.Lock() + defer ctx.Map.m.Unlock() + for _, obj := range ctx.Map.objects { + switch e := obj.(type) { + case *mo.ComputeResource: + if b.Self == *e.EnvironmentBrowser { + return e.Host + } + case *ClusterComputeResource: + if b.Self == *e.EnvironmentBrowser { + return e.Host + } + } + } + return nil +} + func (b *EnvironmentBrowser) QueryConfigOption(req *types.QueryConfigOption) soap.HasFault { body := new(methods.QueryConfigOptionBody) - opt := &types.VirtualMachineConfigOption{ - Version: esx.HardwareVersion, - DefaultDevice: esx.VirtualDevice, + opt := b.QueryConfigOptionResponse.Returnval + if opt == nil { + opt = &types.VirtualMachineConfigOption{ + Version: esx.HardwareVersion, + DefaultDevice: esx.VirtualDevice, + } } body.Res = &types.QueryConfigOptionResponse{ @@ -49,12 +74,56 @@ func (b *EnvironmentBrowser) QueryConfigOption(req *types.QueryConfigOption) soa return body } +func guestFamily(id string) string { + // TODO: We could capture the entire GuestOsDescriptor list from EnvironmentBrowser, + // but it is a ton of data.. this should be good enough for now. + switch { + case strings.HasPrefix(id, "win"): + return string(types.VirtualMachineGuestOsFamilyWindowsGuest) + case strings.HasPrefix(id, "darwin"): + return string(types.VirtualMachineGuestOsFamilyDarwinGuestFamily) + default: + return string(types.VirtualMachineGuestOsFamilyLinuxGuest) + } +} + func (b *EnvironmentBrowser) QueryConfigOptionEx(req *types.QueryConfigOptionEx) soap.HasFault { body := new(methods.QueryConfigOptionExBody) - opt := &types.VirtualMachineConfigOption{ - Version: esx.HardwareVersion, - DefaultDevice: esx.VirtualDevice, + opt := b.QueryConfigOptionResponse.Returnval + if opt == nil { + opt = &types.VirtualMachineConfigOption{ + Version: esx.HardwareVersion, + DefaultDevice: esx.VirtualDevice, + } + } + + if req.Spec != nil { + // From the SDK QueryConfigOptionEx doc: + // "If guestId is nonempty, the guestOSDescriptor array of the config option is filtered to match against the guest IDs in the spec. + // If there is no match, the whole list is returned." + for _, id := range req.Spec.GuestId { + for _, gid := range GuestID { + if string(gid) == id { + opt.GuestOSDescriptor = []types.GuestOsDescriptor{{ + Id: id, + Family: guestFamily(id), + }} + + break + } + } + } + } + + if len(opt.GuestOSDescriptor) == 0 { + for i := range GuestID { + id := string(GuestID[i]) + opt.GuestOSDescriptor = append(opt.GuestOSDescriptor, types.GuestOsDescriptor{ + Id: id, + Family: guestFamily(id), + }) + } } body.Res = &types.QueryConfigOptionExResponse{ @@ -63,3 +132,104 @@ func (b *EnvironmentBrowser) QueryConfigOptionEx(req *types.QueryConfigOptionEx) return body } + +func (b *EnvironmentBrowser) QueryConfigOptionDescriptor(ctx *Context, req *types.QueryConfigOptionDescriptor) soap.HasFault { + body := &methods.QueryConfigOptionDescriptorBody{ + Res: new(types.QueryConfigOptionDescriptorResponse), + } + + body.Res.Returnval = []types.VirtualMachineConfigOptionDescriptor{{ + Key: esx.HardwareVersion, + Description: esx.HardwareVersion, + Host: b.hosts(ctx), + CreateSupported: types.NewBool(true), + DefaultConfigOption: types.NewBool(false), + RunSupported: types.NewBool(true), + UpgradeSupported: types.NewBool(true), + }} + + return body +} + +func (b *EnvironmentBrowser) QueryConfigTarget(ctx *Context, req *types.QueryConfigTarget) soap.HasFault { + body := &methods.QueryConfigTargetBody{ + Res: &types.QueryConfigTargetResponse{ + Returnval: &types.ConfigTarget{ + SmcPresent: types.NewBool(false), + }, + }, + } + target := body.Res.Returnval + + var hosts []types.ManagedObjectReference + if req.Host == nil { + hosts = b.hosts(ctx) + } else { + hosts = append(hosts, *req.Host) + } + + seen := make(map[types.ManagedObjectReference]bool) + + for i := range hosts { + host := ctx.Map.Get(hosts[i]).(*HostSystem) + target.NumCpus += int32(host.Summary.Hardware.NumCpuPkgs) + target.NumCpuCores += int32(host.Summary.Hardware.NumCpuCores) + target.NumNumaNodes++ + + for _, ref := range host.Datastore { + if seen[ref] { + continue + } + seen[ref] = true + + ds := ctx.Map.Get(ref).(*Datastore) + target.Datastore = append(target.Datastore, types.VirtualMachineDatastoreInfo{ + VirtualMachineTargetInfo: types.VirtualMachineTargetInfo{ + Name: ds.Name, + }, + Datastore: ds.Summary, + Capability: ds.Capability, + Mode: string(types.HostMountModeReadWrite), + VStorageSupport: string(types.FileSystemMountInfoVStorageSupportStatusVStorageUnsupported), + }) + } + + for _, ref := range host.Network { + if seen[ref] { + continue + } + seen[ref] = true + + switch n := ctx.Map.Get(ref).(type) { + case *mo.Network: + target.Network = append(target.Network, types.VirtualMachineNetworkInfo{ + VirtualMachineTargetInfo: types.VirtualMachineTargetInfo{ + Name: n.Name, + }, + Network: n.Summary.GetNetworkSummary(), + }) + case *DistributedVirtualPortgroup: + dvs := ctx.Map.Get(*n.Config.DistributedVirtualSwitch).(*DistributedVirtualSwitch) + target.DistributedVirtualPortgroup = append(target.DistributedVirtualPortgroup, types.DistributedVirtualPortgroupInfo{ + SwitchName: dvs.Name, + SwitchUuid: dvs.Uuid, + PortgroupName: n.Name, + PortgroupKey: n.Key, + PortgroupType: n.Config.Type, + UplinkPortgroup: false, + Portgroup: n.Self, + NetworkReservationSupported: types.NewBool(false), + }) + case *DistributedVirtualSwitch: + target.DistributedVirtualSwitch = append(target.DistributedVirtualSwitch, types.DistributedVirtualSwitchInfo{ + SwitchName: n.Name, + SwitchUuid: n.Uuid, + DistributedVirtualSwitch: n.Self, + NetworkReservationSupported: types.NewBool(false), + }) + } + } + } + + return body +} diff --git a/vendor/github.com/vmware/govmomi/simulator/esx/authorization_manager.go b/vendor/github.com/vmware/govmomi/simulator/esx/authorization_manager.go index e72c06c851f..d76459be9ef 100644 --- a/vendor/github.com/vmware/govmomi/simulator/esx/authorization_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/esx/authorization_manager.go @@ -30,7 +30,7 @@ var RoleList = []types.AuthorizationRole{ Label: "No cryptography administrator", Summary: "Full access without Cryptographic operations privileges", }, - Privilege: nil, + Privilege: []string{"Alarm.Acknowledge", "Alarm.Create", "Alarm.Delete", "Alarm.DisableActions", "Alarm.Edit", "Alarm.SetStatus", "Authorization.ModifyPermissions", "Authorization.ModifyPrivileges", "Authorization.ModifyRoles", "Authorization.ReassignRolePermissions", "AutoDeploy.Host.AssociateMachine", "AutoDeploy.Profile.Create", "AutoDeploy.Profile.Edit", "AutoDeploy.Rule.Create", "AutoDeploy.Rule.Delete", "AutoDeploy.Rule.Edit", "AutoDeploy.RuleSet.Activate", "AutoDeploy.RuleSet.Edit", "Certificate.Manage", "ContentLibrary.AddLibraryItem", "ContentLibrary.CreateLocalLibrary", "ContentLibrary.CreateSubscribedLibrary", "ContentLibrary.DeleteLibraryItem", "ContentLibrary.DeleteLocalLibrary", "ContentLibrary.DeleteSubscribedLibrary", "ContentLibrary.DownloadSession", "ContentLibrary.EvictLibraryItem", "ContentLibrary.EvictSubscribedLibrary", "ContentLibrary.GetConfiguration", "ContentLibrary.ImportStorage", "ContentLibrary.ProbeSubscription", "ContentLibrary.ReadStorage", "ContentLibrary.SyncLibrary", "ContentLibrary.SyncLibraryItem", "ContentLibrary.TypeIntrospection", "ContentLibrary.UpdateConfiguration", "ContentLibrary.UpdateLibrary", "ContentLibrary.UpdateLibraryItem", "ContentLibrary.UpdateLocalLibrary", "ContentLibrary.UpdateSession", "ContentLibrary.UpdateSubscribedLibrary", "DVPortgroup.Create", "DVPortgroup.Delete", "DVPortgroup.Modify", "DVPortgroup.PolicyOp", "DVPortgroup.ScopeOp", "DVSwitch.Create", "DVSwitch.Delete", "DVSwitch.HostOp", "DVSwitch.Modify", "DVSwitch.Move", "DVSwitch.PolicyOp", "DVSwitch.PortConfig", "DVSwitch.PortSetting", "DVSwitch.ResourceManagement", "DVSwitch.Vspan", "Datacenter.Create", "Datacenter.Delete", "Datacenter.IpPoolConfig", "Datacenter.IpPoolQueryAllocations", "Datacenter.IpPoolReleaseIp", "Datacenter.Move", "Datacenter.Reconfigure", "Datacenter.Rename", "Datastore.AllocateSpace", "Datastore.Browse", "Datastore.Config", "Datastore.Delete", "Datastore.DeleteFile", "Datastore.FileManagement", "Datastore.Move", "Datastore.Rename", "Datastore.UpdateVirtualMachineFiles", "Datastore.UpdateVirtualMachineMetadata", "EAM.Config", "EAM.Modify", "EAM.View", "Extension.Register", "Extension.Unregister", "Extension.Update", "ExternalStatsProvider.Register", "ExternalStatsProvider.Unregister", "ExternalStatsProvider.Update", "Folder.Create", "Folder.Delete", "Folder.Move", "Folder.Rename", "Global.CancelTask", "Global.CapacityPlanning", "Global.DisableMethods", "Global.EnableMethods", "Global.GlobalTag", "Global.Health", "Global.Licenses", "Global.LogEvent", "Global.ManageCustomFields", "Global.Proxy", "Global.ScriptAction", "Global.ServiceManagers", "Global.SetCustomField", "Global.Settings", "Global.SystemTag", "Global.VCServer", "HealthUpdateProvider.Register", "HealthUpdateProvider.Unregister", "HealthUpdateProvider.Update", "Host.Cim.CimInteraction", "Host.Config.AdvancedConfig", "Host.Config.AuthenticationStore", "Host.Config.AutoStart", "Host.Config.Connection", "Host.Config.DateTime", "Host.Config.Firmware", "Host.Config.HyperThreading", "Host.Config.Image", "Host.Config.Maintenance", "Host.Config.Memory", "Host.Config.NetService", "Host.Config.Network", "Host.Config.Patch", "Host.Config.PciPassthru", "Host.Config.Power", "Host.Config.Quarantine", "Host.Config.Resources", "Host.Config.Settings", "Host.Config.Snmp", "Host.Config.Storage", "Host.Config.SystemManagement", "Host.Hbr.HbrManagement", "Host.Inventory.CreateCluster", "Host.Inventory.DeleteCluster", "Host.Inventory.EditCluster", "Host.Inventory.MoveCluster", "Host.Inventory.MoveHost", "Host.Inventory.RemoveHostFromCluster", "Host.Inventory.RenameCluster", "Host.Local.CreateVM", "Host.Local.DeleteVM", "Host.Local.InstallAgent", "Host.Local.ReconfigVM", "InventoryService.Tagging.AttachTag", "InventoryService.Tagging.CreateCategory", "InventoryService.Tagging.CreateTag", "InventoryService.Tagging.DeleteCategory", "InventoryService.Tagging.DeleteTag", "InventoryService.Tagging.EditCategory", "InventoryService.Tagging.EditTag", "InventoryService.Tagging.ModifyUsedByForCategory", "InventoryService.Tagging.ModifyUsedByForTag", "Network.Assign", "Network.Config", "Network.Delete", "Network.Move", "Performance.ModifyIntervals", "Profile.Clear", "Profile.Create", "Profile.Delete", "Profile.Edit", "Profile.Export", "Profile.View", "Resource.ApplyRecommendation", "Resource.AssignVAppToPool", "Resource.AssignVMToPool", "Resource.ColdMigrate", "Resource.CreatePool", "Resource.DeletePool", "Resource.EditPool", "Resource.HotMigrate", "Resource.MovePool", "Resource.QueryVMotion", "Resource.RenamePool", "ScheduledTask.Create", "ScheduledTask.Delete", "ScheduledTask.Edit", "ScheduledTask.Run", "Sessions.GlobalMessage", "Sessions.ImpersonateUser", "Sessions.TerminateSession", "Sessions.ValidateSession", "StoragePod.Config", "StorageProfile.Update", "StorageProfile.View", "StorageViews.ConfigureService", "StorageViews.View", "System.Anonymous", "System.Read", "System.View", "Task.Create", "Task.Update", "TransferService.Manage", "TransferService.Monitor", "VApp.ApplicationConfig", "VApp.AssignResourcePool", "VApp.AssignVApp", "VApp.AssignVM", "VApp.Clone", "VApp.Create", "VApp.Delete", "VApp.Export", "VApp.ExtractOvfEnvironment", "VApp.Import", "VApp.InstanceConfig", "VApp.ManagedByConfig", "VApp.Move", "VApp.PowerOff", "VApp.PowerOn", "VApp.Rename", "VApp.ResourceConfig", "VApp.Suspend", "VApp.Unregister", "VRMPolicy.Query", "VRMPolicy.Update", "VirtualMachine.Config.AddExistingDisk", "VirtualMachine.Config.AddNewDisk", "VirtualMachine.Config.AddRemoveDevice", "VirtualMachine.Config.AdvancedConfig", "VirtualMachine.Config.Annotation", "VirtualMachine.Config.CPUCount", "VirtualMachine.Config.ChangeTracking", "VirtualMachine.Config.DiskExtend", "VirtualMachine.Config.DiskLease", "VirtualMachine.Config.EditDevice", "VirtualMachine.Config.HostUSBDevice", "VirtualMachine.Config.ManagedBy", "VirtualMachine.Config.Memory", "VirtualMachine.Config.MksControl", "VirtualMachine.Config.QueryFTCompatibility", "VirtualMachine.Config.QueryUnownedFiles", "VirtualMachine.Config.RawDevice", "VirtualMachine.Config.ReloadFromPath", "VirtualMachine.Config.RemoveDisk", "VirtualMachine.Config.Rename", "VirtualMachine.Config.ResetGuestInfo", "VirtualMachine.Config.Resource", "VirtualMachine.Config.Settings", "VirtualMachine.Config.SwapPlacement", "VirtualMachine.Config.ToggleForkParent", "VirtualMachine.Config.Unlock", "VirtualMachine.Config.UpgradeVirtualHardware", "VirtualMachine.GuestOperations.Execute", "VirtualMachine.GuestOperations.Modify", "VirtualMachine.GuestOperations.ModifyAliases", "VirtualMachine.GuestOperations.Query", "VirtualMachine.GuestOperations.QueryAliases", "VirtualMachine.Hbr.ConfigureReplication", "VirtualMachine.Hbr.MonitorReplication", "VirtualMachine.Hbr.ReplicaManagement", "VirtualMachine.Interact.AnswerQuestion", "VirtualMachine.Interact.Backup", "VirtualMachine.Interact.ConsoleInteract", "VirtualMachine.Interact.CreateScreenshot", "VirtualMachine.Interact.CreateSecondary", "VirtualMachine.Interact.DefragmentAllDisks", "VirtualMachine.Interact.DeviceConnection", "VirtualMachine.Interact.DisableSecondary", "VirtualMachine.Interact.DnD", "VirtualMachine.Interact.EnableSecondary", "VirtualMachine.Interact.MakePrimary", "VirtualMachine.Interact.Pause", "VirtualMachine.Interact.PowerOff", "VirtualMachine.Interact.PowerOn", "VirtualMachine.Interact.PutUsbScanCodes", "VirtualMachine.Interact.Record", "VirtualMachine.Interact.Replay", "VirtualMachine.Interact.Reset", "VirtualMachine.Interact.SESparseMaintenance", "VirtualMachine.Interact.SetCDMedia", "VirtualMachine.Interact.SetFloppyMedia", "VirtualMachine.Interact.Suspend", "VirtualMachine.Interact.TerminateFaultTolerantVM", "VirtualMachine.Interact.ToolsInstall", "VirtualMachine.Interact.TurnOffFaultTolerance", "VirtualMachine.Inventory.Create", "VirtualMachine.Inventory.CreateFromExisting", "VirtualMachine.Inventory.Delete", "VirtualMachine.Inventory.Move", "VirtualMachine.Inventory.Register", "VirtualMachine.Inventory.Unregister", "VirtualMachine.Namespace.Event", "VirtualMachine.Namespace.EventNotify", "VirtualMachine.Namespace.Management", "VirtualMachine.Namespace.ModifyContent", "VirtualMachine.Namespace.Query", "VirtualMachine.Namespace.ReadContent", "VirtualMachine.Provisioning.Clone", "VirtualMachine.Provisioning.CloneTemplate", "VirtualMachine.Provisioning.CreateTemplateFromVM", "VirtualMachine.Provisioning.Customize", "VirtualMachine.Provisioning.DeployTemplate", "VirtualMachine.Provisioning.DiskRandomAccess", "VirtualMachine.Provisioning.DiskRandomRead", "VirtualMachine.Provisioning.FileRandomAccess", "VirtualMachine.Provisioning.GetVmFiles", "VirtualMachine.Provisioning.MarkAsTemplate", "VirtualMachine.Provisioning.MarkAsVM", "VirtualMachine.Provisioning.ModifyCustSpecs", "VirtualMachine.Provisioning.PromoteDisks", "VirtualMachine.Provisioning.PutVmFiles", "VirtualMachine.Provisioning.ReadCustSpecs", "VirtualMachine.State.CreateSnapshot", "VirtualMachine.State.RemoveSnapshot", "VirtualMachine.State.RenameSnapshot", "VirtualMachine.State.RevertToSnapshot", "vService.CreateDependency", "vService.DestroyDependency", "vService.ReconfigureDependency", "vService.UpdateDependency"}, }, { RoleId: -5, diff --git a/vendor/github.com/vmware/govmomi/simulator/esx/event_manager.go b/vendor/github.com/vmware/govmomi/simulator/esx/event_manager.go index 7024b404a63..0a572770f77 100644 --- a/vendor/github.com/vmware/govmomi/simulator/esx/event_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/esx/event_manager.go @@ -93,7 +93,7 @@ var EventInfo = []types.EventDescriptionEventDetail{ Key: "VmMigratedEvent", Description: "VM migrated", Category: "info", - FullFormat: "Migration of virtual machine {{.Vm.Name}} from {{.SourceHost.Name}, {{.SourceDatastore.Name}} to {{.Host.Name}, {{.Ds.Name}} completed", + FullFormat: "Migration of virtual machine {{.Vm.Name}} from {{.SourceHost.Name}}, {{.SourceDatastore.Name}} to {{.Host.Name}}, {{.Ds.Name}} completed", }, { Key: "VmBeingMigratedEvent", @@ -233,6 +233,24 @@ var EventInfo = []types.EventDescriptionEventDetail{ Category: "info", FullFormat: "Completed the relocation of the virtual machine", }, + { + Key: "CustomizationFailed", + Description: "An error occurred during customization", + Category: "info", + FullFormat: "An error occurred during customization on VM {{.Vm.Name}}", + }, + { + Key: "CustomizationStartedEvent", + Description: "Started customization", + Category: "info", + FullFormat: "Started customization of VM {{.Vm.Name}}", + }, + { + Key: "CustomizationSucceeded", + Description: "Customization succeeded", + Category: "info", + FullFormat: "Customization of VM {{.Vm.Name}} succeeded", + }, { Key: "DrsVmMigratedEvent", Description: "DRS VM migrated", diff --git a/vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go b/vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go index a55e87162b1..fd7877b28c9 100644 --- a/vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go +++ b/vendor/github.com/vmware/govmomi/simulator/esx/host_config_info.go @@ -544,6 +544,30 @@ var HostConfigInfo = types.HostConfigInfo{ NicType: "management", MultiSelectAllowed: true, CandidateVnic: []types.HostVirtualNic{ + { + Device: "vmk1", + Key: "management.key-vim.host.VirtualNic-vmk1", + Portgroup: "", + Spec: types.HostVirtualNicSpec{ + Ip: &types.HostIpConfig{ + Dhcp: true, + IpAddress: "192.168.0.1", + SubnetMask: "255.0.0.0", + IpV6Config: (*types.HostIpConfigIpV6AddressConfiguration)(nil), + }, + Mac: "00:0c:29:81:d8:00", + DistributedVirtualPort: (*types.DistributedVirtualSwitchPortConnection)(nil), + Portgroup: "Management Network", + Mtu: 1500, + TsoEnabled: types.NewBool(true), + NetStackInstanceKey: "defaultTcpipStack", + OpaqueNetwork: (*types.HostVirtualNicOpaqueNetworkSpec)(nil), + ExternalId: "", + PinnedPnic: "", + IpRouteSpec: (*types.HostVirtualNicIpRouteSpec)(nil), + }, + Port: "", + }, { Device: "vmk0", Key: "management.key-vim.host.VirtualNic-vmk0", diff --git a/vendor/github.com/vmware/govmomi/simulator/esx/host_system.go b/vendor/github.com/vmware/govmomi/simulator/esx/host_system.go index 445ac815b2f..26cd1962f64 100644 --- a/vendor/github.com/vmware/govmomi/simulator/esx/host_system.go +++ b/vendor/github.com/vmware/govmomi/simulator/esx/host_system.go @@ -1740,9 +1740,19 @@ var HostSystem = mo.HostSystem{ CurrentEVCModeKey: "", Gateway: (*types.HostListSummaryGatewaySummary)(nil), }, - Hardware: (*types.HostHardwareInfo)(nil), - Capability: (*types.HostCapability)(nil), - LicensableResource: types.HostLicensableResourceInfo{}, + Hardware: (*types.HostHardwareInfo)(nil), + Capability: (*types.HostCapability)(nil), + LicensableResource: types.HostLicensableResourceInfo{ + Resource: []types.KeyAnyValue{ + { + Key: "numCpuPackages", + Value: types.KeyValue{ + Key: "numCpuPackages", + Value: "2", + }, + }, + }, + }, ConfigManager: types.HostConfigManager{ DynamicData: types.DynamicData{}, CpuScheduler: &types.ManagedObjectReference{Type: "HostCpuSchedulerSystem", Value: "cpuSchedulerSystem"}, diff --git a/vendor/github.com/vmware/govmomi/simulator/esx/task_manager.go b/vendor/github.com/vmware/govmomi/simulator/esx/task_manager.go index a499eb97518..b429ad4902e 100644 --- a/vendor/github.com/vmware/govmomi/simulator/esx/task_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/esx/task_manager.go @@ -9735,7 +9735,7 @@ var Description = types.TaskDescription{ &types.ElementDescription{ Description: types.Description{ Label: "Retrieve Managed Method Executer", - Summary: "Retrieves a referemce to Managed Method Executer", + Summary: "Retrieves a reference to Managed Method Executer", }, Key: "HostSystem.retrieveManagedMethodExecuter", }, @@ -9819,7 +9819,7 @@ var Description = types.TaskDescription{ &types.ElementDescription{ Description: types.Description{ Label: "Query feature capabilities for vSphere Distributed Switch specification", - Summary: "Queries feature capabilites available for a given vSphere Distributed Switch specification", + Summary: "Queries feature capabilities available for a given vSphere Distributed Switch specification", }, Key: "dvs.DistributedVirtualSwitchManager.queryFeatureCapability", }, diff --git a/vendor/github.com/vmware/govmomi/simulator/event_manager.go b/vendor/github.com/vmware/govmomi/simulator/event_manager.go index fe1d63a8681..329a761eaca 100644 --- a/vendor/github.com/vmware/govmomi/simulator/event_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/event_manager.go @@ -18,13 +18,12 @@ package simulator import ( "bytes" - "container/ring" + "container/list" "log" "reflect" "text/template" "time" - "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/simulator/esx" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" @@ -40,27 +39,26 @@ var ( type EventManager struct { mo.EventManager - root types.ManagedObjectReference - page *ring.Ring - key int32 + root types.ManagedObjectReference + + history *list.List + key int32 + collectors map[types.ManagedObjectReference]*EventHistoryCollector templates map[string]*template.Template } -func NewEventManager(ref types.ManagedObjectReference) object.Reference { - return &EventManager{ - EventManager: mo.EventManager{ - Self: ref, - Description: types.EventDescription{ - EventInfo: esx.EventInfo, - }, - MaxCollector: 1000, - }, - root: Map.content().RootFolder, - page: ring.New(maxPageSize), - collectors: make(map[types.ManagedObjectReference]*EventHistoryCollector), - templates: make(map[string]*template.Template), +func (m *EventManager) init(r *Registry) { + if len(m.Description.EventInfo) == 0 { + m.Description.EventInfo = esx.EventInfo } + if m.MaxCollector == 0 { + m.MaxCollector = 1000 + } + m.root = r.content().RootFolder + m.history = list.New() + m.collectors = make(map[types.ManagedObjectReference]*EventHistoryCollector) + m.templates = make(map[string]*template.Template) } func (m *EventManager) createCollector(ctx *Context, req *types.CreateCollectorForEvents) (*EventHistoryCollector, *soap.Fault) { @@ -75,10 +73,11 @@ func (m *EventManager) createCollector(ctx *Context, req *types.CreateCollectorF collector := &EventHistoryCollector{ m: m, - page: ring.New(size), + page: list.New(), + size: size, } collector.Filter = req.Filter - collector.fillPage(size) + collector.fillPage() return collector, nil } @@ -151,6 +150,13 @@ func (m *EventManager) formatMessage(event types.BaseEvent) { } } +func pushEvent(l *list.List, event types.BaseEvent) { + if l.Len() > maxPageSize*5 { + l.Remove(l.Front()) // Prune history + } + l.PushBack(event) +} + func (m *EventManager) PostEvent(ctx *Context, req *types.PostEvent) soap.HasFault { m.key++ event := req.EventToPost.GetEvent() @@ -159,15 +165,14 @@ func (m *EventManager) PostEvent(ctx *Context, req *types.PostEvent) soap.HasFau event.CreatedTime = time.Now() event.UserName = ctx.Session.UserName - m.page = m.page.Prev() - m.page.Value = req.EventToPost m.formatMessage(req.EventToPost) + pushEvent(m.history, req.EventToPost) + for _, c := range m.collectors { ctx.WithLock(c, func() { if c.eventMatches(req.EventToPost) { - c.page = c.page.Prev() - c.page.Value = req.EventToPost + pushEvent(c.page, req.EventToPost) Map.Update(c, []types.PropertyChange{{Name: "latestPage", Val: c.GetLatestPage()}}) } }) @@ -182,8 +187,9 @@ type EventHistoryCollector struct { mo.EventHistoryCollector m *EventManager - page *ring.Ring - pos int + size int + page *list.List + pos *list.Element } // doEntityEventArgument calls f for each entity argument in the event. @@ -316,54 +322,55 @@ func (c *EventHistoryCollector) typeMatches(event types.BaseEvent, spec *types.E return false } +func (c *EventHistoryCollector) timeMatches(event types.BaseEvent, spec *types.EventFilterSpec) bool { + if spec.Time == nil { + return true + } + + created := event.GetEvent().CreatedTime + + if begin := spec.Time.BeginTime; begin != nil { + if created.Before(*begin) { + return false + } + } + + if end := spec.Time.EndTime; end != nil { + if created.After(*end) { + return false + } + } + + return true +} + // eventMatches returns true one of the filters matches the event. func (c *EventHistoryCollector) eventMatches(event types.BaseEvent) bool { spec := c.Filter.(types.EventFilterSpec) - if !c.typeMatches(event, &spec) { - return false + matchers := []func(types.BaseEvent, *types.EventFilterSpec) bool{ + c.typeMatches, + c.timeMatches, + c.entityMatches, + // TODO: spec.UserName, etc } - // TODO: spec.Time, spec.UserName, etc + for _, match := range matchers { + if !match(event, &spec) { + return false + } + } - return c.entityMatches(event, &spec) + return true } -// filePage copies the manager's latest events into the collector's page with Filter applied. -func (c *EventHistoryCollector) fillPage(size int) { - c.pos = 0 - l := c.page.Len() - delta := size - l - - if delta < 0 { - // Shrink ring size - c.page = c.page.Unlink(-delta) - return - } - - matches := 0 - mpage := c.m.page - page := c.page - - if delta != 0 { - // Grow ring size - c.page = c.page.Link(ring.New(delta)) - } - - for i := 0; i < maxPageSize; i++ { - event, ok := mpage.Value.(types.BaseEvent) - mpage = mpage.Prev() - if !ok { - continue - } +// fillPage copies the manager's latest events into the collector's page with Filter applied. +func (c *EventHistoryCollector) fillPage() { + for e := c.m.history.Front(); e != nil; e = e.Next() { + event := e.Value.(types.BaseEvent) if c.eventMatches(event) { - page.Value = event - page = page.Prev() - matches++ - if matches == size { - break - } + c.page.PushBack(event) } } } @@ -388,21 +395,47 @@ func (c *EventHistoryCollector) SetCollectorPageSize(ctx *Context, req *types.Se return body } - ctx.WithLock(c.m, func() { - c.fillPage(size) - }) + c.size = size + c.page = list.New() + ctx.WithLock(c.m, c.fillPage) body.Res = new(types.SetCollectorPageSizeResponse) return body } +func (c *EventHistoryCollector) ResetCollector(ctx *Context, req *types.ResetCollector) soap.HasFault { + c.pos = c.page.Back() + + return &methods.ResetCollectorBody{ + Res: new(types.ResetCollectorResponse), + } +} + func (c *EventHistoryCollector) RewindCollector(ctx *Context, req *types.RewindCollector) soap.HasFault { - c.pos = 0 + c.pos = c.page.Front() + return &methods.RewindCollectorBody{ Res: new(types.RewindCollectorResponse), } } +// readEvents returns the next max Events from the EventManager's history +func (c *EventHistoryCollector) readEvents(ctx *Context, max int32, next func() *list.Element) []types.BaseEvent { + var events []types.BaseEvent + + for i := 0; i < int(max); i++ { + e := next() + if e == nil { + break + } + + events = append(events, e.Value.(types.BaseEvent)) + c.pos = e + } + + return events +} + func (c *EventHistoryCollector) ReadNextEvents(ctx *Context, req *types.ReadNextEvents) soap.HasFault { body := &methods.ReadNextEventsBody{} if req.MaxCount <= 0 { @@ -411,21 +444,14 @@ func (c *EventHistoryCollector) ReadNextEvents(ctx *Context, req *types.ReadNext } body.Res = new(types.ReadNextEventsResponse) - events := c.GetLatestPage() - nevents := len(events) - if c.pos == nevents { - return body // already read to EOF + next := func() *list.Element { + if c.pos != nil { + return c.pos.Next() + } + return c.page.Front() } - start := c.pos - end := start + int(req.MaxCount) - c.pos += int(req.MaxCount) - if end > nevents { - end = nevents - c.pos = nevents - } - - body.Res.Returnval = events[start:end] + body.Res.Returnval = c.readEvents(ctx, req.MaxCount, next) return body } @@ -438,26 +464,20 @@ func (c *EventHistoryCollector) ReadPreviousEvents(ctx *Context, req *types.Read } body.Res = new(types.ReadPreviousEventsResponse) - events := c.GetLatestPage() - if c.pos == 0 { - return body // already read to EOF + next := func() *list.Element { + if c.pos != nil { + return c.pos.Prev() + } + return c.page.Back() } - start := c.pos - int(req.MaxCount) - end := c.pos - c.pos -= int(req.MaxCount) - if start < 0 { - start = 0 - c.pos = 0 - } - - body.Res.Returnval = events[start:end] + body.Res.Returnval = c.readEvents(ctx, req.MaxCount, next) return body } func (c *EventHistoryCollector) DestroyCollector(ctx *Context, req *types.DestroyCollector) soap.HasFault { - ctx.Session.Remove(req.This) + ctx.Session.Remove(ctx, req.This) ctx.WithLock(c.m, func() { delete(c.m.collectors, req.This) @@ -471,12 +491,14 @@ func (c *EventHistoryCollector) DestroyCollector(ctx *Context, req *types.Destro func (c *EventHistoryCollector) GetLatestPage() []types.BaseEvent { var latestPage []types.BaseEvent - c.page.Do(func(val interface{}) { - if val == nil { - return + e := c.page.Back() + for i := 0; i < c.size; i++ { + if e == nil { + break } - latestPage = append(latestPage, val.(types.BaseEvent)) - }) + latestPage = append(latestPage, e.Value.(types.BaseEvent)) + e = e.Prev() + } return latestPage } diff --git a/vendor/github.com/vmware/govmomi/simulator/file_manager.go b/vendor/github.com/vmware/govmomi/simulator/file_manager.go index 961bfaeaa36..161ebf73f8f 100644 --- a/vendor/github.com/vmware/govmomi/simulator/file_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/file_manager.go @@ -20,8 +20,8 @@ import ( "io" "os" "path" + "path/filepath" - "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/simulator/esx" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" @@ -33,30 +33,30 @@ type FileManager struct { mo.FileManager } -func NewFileManager(ref types.ManagedObjectReference) object.Reference { - m := &FileManager{} - m.Self = ref - return m -} - func (f *FileManager) findDatastore(ref mo.Reference, name string) (*Datastore, types.BaseMethodFault) { var refs []types.ManagedObjectReference - switch obj := ref.(type) { - case *Folder: - refs = obj.ChildEntity - case *StoragePod: - refs = obj.ChildEntity + if d, ok := asFolderMO(ref); ok { + refs = d.ChildEntity + } + if p, ok := ref.(*StoragePod); ok { + refs = p.ChildEntity } for _, ref := range refs { - switch obj := Map.Get(ref).(type) { - case *Datastore: - if obj.Name == name { - return obj, nil + obj := Map.Get(ref) + + if ds, ok := obj.(*Datastore); ok && ds.Name == name { + return ds, nil + } + if p, ok := obj.(*StoragePod); ok { + ds, _ := f.findDatastore(p, name) + if ds != nil { + return ds, nil } - case *Folder, *StoragePod: - ds, _ := f.findDatastore(obj, name) + } + if d, ok := asFolderMO(obj); ok { + ds, _ := f.findDatastore(d, name) if ds != nil { return ds, nil } @@ -126,14 +126,14 @@ func (f *FileManager) deleteDatastoreFile(req *types.DeleteDatastoreFile_Task) t return nil } -func (f *FileManager) DeleteDatastoreFileTask(req *types.DeleteDatastoreFile_Task) soap.HasFault { +func (f *FileManager) DeleteDatastoreFileTask(ctx *Context, req *types.DeleteDatastoreFile_Task) soap.HasFault { task := CreateTask(f, "deleteDatastoreFile", func(*Task) (types.AnyType, types.BaseMethodFault) { return nil, f.deleteDatastoreFile(req) }) return &methods.DeleteDatastoreFile_TaskBody{ Res: &types.DeleteDatastoreFile_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } @@ -190,14 +190,14 @@ func (f *FileManager) moveDatastoreFile(req *types.MoveDatastoreFile_Task) types return nil } -func (f *FileManager) MoveDatastoreFileTask(req *types.MoveDatastoreFile_Task) soap.HasFault { +func (f *FileManager) MoveDatastoreFileTask(ctx *Context, req *types.MoveDatastoreFile_Task) soap.HasFault { task := CreateTask(f, "moveDatastoreFile", func(*Task) (types.AnyType, types.BaseMethodFault) { return nil, f.moveDatastoreFile(req) }) return &methods.MoveDatastoreFile_TaskBody{ Res: &types.MoveDatastoreFile_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } @@ -220,7 +220,7 @@ func (f *FileManager) copyDatastoreFile(req *types.CopyDatastoreFile_Task) types } } - r, err := os.Open(src) + r, err := os.Open(filepath.Clean(src)) if err != nil { return f.fault(dst, err, new(types.CannotAccessFile)) } @@ -239,14 +239,14 @@ func (f *FileManager) copyDatastoreFile(req *types.CopyDatastoreFile_Task) types return nil } -func (f *FileManager) CopyDatastoreFileTask(req *types.CopyDatastoreFile_Task) soap.HasFault { +func (f *FileManager) CopyDatastoreFileTask(ctx *Context, req *types.CopyDatastoreFile_Task) soap.HasFault { task := CreateTask(f, "copyDatastoreFile", func(*Task) (types.AnyType, types.BaseMethodFault) { return nil, f.copyDatastoreFile(req) }) return &methods.CopyDatastoreFile_TaskBody{ Res: &types.CopyDatastoreFile_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } diff --git a/vendor/github.com/vmware/govmomi/simulator/folder.go b/vendor/github.com/vmware/govmomi/simulator/folder.go index 7dfe654496b..a30094383aa 100644 --- a/vendor/github.com/vmware/govmomi/simulator/folder.go +++ b/vendor/github.com/vmware/govmomi/simulator/folder.go @@ -17,12 +17,16 @@ limitations under the License. package simulator import ( + "errors" "fmt" "math/rand" + "net/url" "path" "strings" + "time" "github.com/google/uuid" + "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" @@ -34,7 +38,15 @@ type Folder struct { mo.Folder } -func (f *Folder) eventArgument() types.FolderEventArgument { +func asFolderMO(obj mo.Reference) (*mo.Folder, bool) { + if obj == nil { + return nil, false + } + f, ok := getManagedObject(obj).Addr().Interface().(*mo.Folder) + return f, ok +} + +func folderEventArgument(f *mo.Folder) types.FolderEventArgument { return types.FolderEventArgument{ Folder: f.Self, EntityEventArgument: types.EntityEventArgument{Name: f.Name}, @@ -42,7 +54,7 @@ func (f *Folder) eventArgument() types.FolderEventArgument { } // update references when objects are added/removed from a Folder -func (f *Folder) update(o mo.Reference, u func(mo.Reference, *[]types.ManagedObjectReference, types.ManagedObjectReference)) { +func folderUpdate(ctx *Context, f *mo.Folder, o mo.Reference, u func(*Context, mo.Reference, *[]types.ManagedObjectReference, types.ManagedObjectReference)) { ref := o.Reference() if f.Parent == nil { @@ -54,17 +66,20 @@ func (f *Folder) update(o mo.Reference, u func(mo.Reference, *[]types.ManagedObj return // nothing to update } - dc := Map.getEntityDatacenter(f) + dc := ctx.Map.getEntityDatacenter(f) switch ref.Type { case "Network", "DistributedVirtualSwitch", "DistributedVirtualPortgroup": - u(dc, &dc.Network, ref) + u(ctx, dc, &dc.Network, ref) case "Datastore": - u(dc, &dc.Datastore, ref) + u(ctx, dc, &dc.Datastore, ref) } } -func networkSummary(n *mo.Network) *types.NetworkSummary { +func networkSummary(n *mo.Network) types.BaseNetworkSummary { + if n.Summary != nil { + return n.Summary + } return &types.NetworkSummary{ Network: &n.Self, Name: n.Name, @@ -72,32 +87,38 @@ func networkSummary(n *mo.Network) *types.NetworkSummary { } } -func (f *Folder) putChild(o mo.Entity) { - Map.PutEntity(f, o) +func folderPutChild(ctx *Context, f *mo.Folder, o mo.Entity) { + ctx.WithLock(f, func() { + // Need to update ChildEntity before Map.Put for ContainerView updates to work properly + f.ChildEntity = append(f.ChildEntity, ctx.Map.reference(o)) + ctx.Map.PutEntity(f, o) - f.ChildEntity = append(f.ChildEntity, o.Reference()) + folderUpdate(ctx, f, o, ctx.Map.AddReference) - f.update(o, Map.AddReference) - - switch e := o.(type) { - case *mo.Network: - e.Summary = networkSummary(e) - case *mo.OpaqueNetwork: - e.Summary = networkSummary(&e.Network) - case *DistributedVirtualPortgroup: - e.Summary = networkSummary(&e.Network) - } + ctx.WithLock(o, func() { + switch e := o.(type) { + case *mo.Network: + e.Summary = networkSummary(e) + case *mo.OpaqueNetwork: + e.Summary = networkSummary(&e.Network) + case *DistributedVirtualPortgroup: + e.Summary = networkSummary(&e.Network) + } + }) + }) } -func (f *Folder) removeChild(o mo.Reference) { - Map.Remove(o.Reference()) +func folderRemoveChild(ctx *Context, f *mo.Folder, o mo.Reference) { + ctx.Map.Remove(ctx, o.Reference()) - RemoveReference(&f.ChildEntity, o.Reference()) + ctx.WithLock(f, func() { + RemoveReference(&f.ChildEntity, o.Reference()) - f.update(o, Map.RemoveReference) + folderUpdate(ctx, f, o, ctx.Map.RemoveReference) + }) } -func (f *Folder) hasChildType(kind string) bool { +func folderHasChildType(f *mo.Folder, kind string) bool { for _, t := range f.ChildType { if t == kind { return true @@ -110,14 +131,46 @@ func (f *Folder) typeNotSupported() *soap.Fault { return Fault(fmt.Sprintf("%s supports types: %#v", f.Self, f.ChildType), &types.NotSupported{}) } +// AddOpaqueNetwork adds an OpaqueNetwork type to the inventory, with default backing to that of an nsx.LogicalSwitch. +// The vSphere API does not have a method to add this directly, so it must either be called directly or via Model.OpaqueNetwork setting. +func (f *Folder) AddOpaqueNetwork(ctx *Context, summary types.OpaqueNetworkSummary) error { + if !folderHasChildType(&f.Folder, "Network") { + return errors.New("not a network folder") + } + + if summary.OpaqueNetworkId == "" { + summary.OpaqueNetworkId = uuid.New().String() + } + if summary.OpaqueNetworkType == "" { + summary.OpaqueNetworkType = "nsx.LogicalSwitch" + } + if summary.Name == "" { + summary.Name = summary.OpaqueNetworkType + "-" + summary.OpaqueNetworkId + } + + net := new(mo.OpaqueNetwork) + if summary.Network == nil { + summary.Network = &net.Self + } else { + net.Self = *summary.Network + } + summary.Accessible = true + net.Network.Name = summary.Name + net.Summary = &summary + + folderPutChild(ctx, &f.Folder, net) + + return nil +} + type addStandaloneHost struct { *Folder - + ctx *Context req *types.AddStandaloneHost_Task } func (add *addStandaloneHost) Run(task *Task) (types.AnyType, types.BaseMethodFault) { - host, err := CreateStandaloneHost(add.Folder, add.req.Spec) + host, err := CreateStandaloneHost(add.ctx, add.Folder, add.req.Spec) if err != nil { return nil, err } @@ -129,12 +182,12 @@ func (add *addStandaloneHost) Run(task *Task) (types.AnyType, types.BaseMethodFa return host.Reference(), nil } -func (f *Folder) AddStandaloneHostTask(a *types.AddStandaloneHost_Task) soap.HasFault { +func (f *Folder) AddStandaloneHostTask(ctx *Context, a *types.AddStandaloneHost_Task) soap.HasFault { r := &methods.AddStandaloneHost_TaskBody{} - if f.hasChildType("ComputeResource") && f.hasChildType("Folder") { + if folderHasChildType(&f.Folder, "ComputeResource") && folderHasChildType(&f.Folder, "Folder") { r.Res = &types.AddStandaloneHost_TaskResponse{ - Returnval: NewTask(&addStandaloneHost{f, a}).Run(), + Returnval: NewTask(&addStandaloneHost{f, ctx, a}).Run(ctx), } } else { r.Fault_ = f.typeNotSupported() @@ -143,16 +196,27 @@ func (f *Folder) AddStandaloneHostTask(a *types.AddStandaloneHost_Task) soap.Has return r } -func (f *Folder) CreateFolder(c *types.CreateFolder) soap.HasFault { +func (f *Folder) CreateFolder(ctx *Context, c *types.CreateFolder) soap.HasFault { r := &methods.CreateFolderBody{} - if f.hasChildType("Folder") { + if folderHasChildType(&f.Folder, "Folder") { + name := escapeSpecialCharacters(c.Name) + + if obj := ctx.Map.FindByName(name, f.ChildEntity); obj != nil { + r.Fault_ = Fault("", &types.DuplicateName{ + Name: name, + Object: f.Self, + }) + + return r + } + folder := &Folder{} - folder.Name = c.Name + folder.Name = name folder.ChildType = f.ChildType - f.putChild(folder) + folderPutChild(ctx, &f.Folder, folder) r.Res = &types.CreateFolderResponse{ Returnval: folder.Self, @@ -164,15 +228,31 @@ func (f *Folder) CreateFolder(c *types.CreateFolder) soap.HasFault { return r } +func escapeSpecialCharacters(name string) string { + name = strings.ReplaceAll(name, `%`, strings.ToLower(url.QueryEscape(`%`))) + name = strings.ReplaceAll(name, `/`, strings.ToLower(url.QueryEscape(`/`))) + name = strings.ReplaceAll(name, `\`, strings.ToLower(url.QueryEscape(`\`))) + return name +} + // StoragePod aka "Datastore Cluster" type StoragePod struct { mo.StoragePod } -func (f *Folder) CreateStoragePod(c *types.CreateStoragePod) soap.HasFault { +func (f *Folder) CreateStoragePod(ctx *Context, c *types.CreateStoragePod) soap.HasFault { r := &methods.CreateStoragePodBody{} - if f.hasChildType("StoragePod") { + if folderHasChildType(&f.Folder, "StoragePod") { + if obj := ctx.Map.FindByName(c.Name, f.ChildEntity); obj != nil { + r.Fault_ = Fault("", &types.DuplicateName{ + Name: c.Name, + Object: f.Self, + }) + + return r + } + pod := &StoragePod{} pod.Name = c.Name @@ -181,7 +261,7 @@ func (f *Folder) CreateStoragePod(c *types.CreateStoragePod) soap.HasFault { pod.PodStorageDrsEntry = new(types.PodStorageDrsEntry) pod.PodStorageDrsEntry.StorageDrsConfig.PodConfig.Enabled = true - f.putChild(pod) + folderPutChild(ctx, &f.Folder, pod) r.Res = &types.CreateStoragePodResponse{ Returnval: pod.Self, @@ -193,20 +273,34 @@ func (f *Folder) CreateStoragePod(c *types.CreateStoragePod) soap.HasFault { return r } -func (p *StoragePod) MoveIntoFolderTask(c *types.MoveIntoFolder_Task) soap.HasFault { - f := &Folder{Folder: p.Folder} - res := f.MoveIntoFolderTask(c) - p.ChildEntity = append(p.ChildEntity, f.ChildEntity...) - return res +func (p *StoragePod) MoveIntoFolderTask(ctx *Context, c *types.MoveIntoFolder_Task) soap.HasFault { + task := CreateTask(p, "moveIntoFolder", func(*Task) (types.AnyType, types.BaseMethodFault) { + f := &Folder{Folder: p.Folder} + id := f.MoveIntoFolderTask(ctx, c).(*methods.MoveIntoFolder_TaskBody).Res.Returnval + ftask := ctx.Map.Get(id).(*Task) + ftask.Wait() + if ftask.Info.Error != nil { + return nil, ftask.Info.Error.Fault + } + p.ChildEntity = append(p.ChildEntity, f.ChildEntity...) + return nil, nil + }) + return &methods.MoveIntoFolder_TaskBody{ + Res: &types.MoveIntoFolder_TaskResponse{ + Returnval: task.Run(ctx), + }, + } } func (f *Folder) CreateDatacenter(ctx *Context, c *types.CreateDatacenter) soap.HasFault { r := &methods.CreateDatacenterBody{} - if f.hasChildType("Datacenter") && f.hasChildType("Folder") { - dc := NewDatacenter(f) + if folderHasChildType(&f.Folder, "Datacenter") && folderHasChildType(&f.Folder, "Folder") { + dc := NewDatacenter(ctx, &f.Folder) - dc.Name = c.Name + ctx.Map.Update(dc, []types.PropertyChange{ + {Name: "name", Val: c.Name}, + }) r.Res = &types.CreateDatacenterResponse{ Returnval: dc.Self, @@ -218,7 +312,7 @@ func (f *Folder) CreateDatacenter(ctx *Context, c *types.CreateDatacenter) soap. Datacenter: datacenterEventArgument(dc), }, }, - Parent: f.eventArgument(), + Parent: folderEventArgument(&f.Folder), }) } else { r.Fault_ = f.typeNotSupported() @@ -227,11 +321,11 @@ func (f *Folder) CreateDatacenter(ctx *Context, c *types.CreateDatacenter) soap. return r } -func (f *Folder) CreateClusterEx(c *types.CreateClusterEx) soap.HasFault { +func (f *Folder) CreateClusterEx(ctx *Context, c *types.CreateClusterEx) soap.HasFault { r := &methods.CreateClusterExBody{} - if f.hasChildType("ComputeResource") && f.hasChildType("Folder") { - cluster, err := CreateClusterComputeResource(f, c.Name, c.Spec) + if folderHasChildType(&f.Folder, "ComputeResource") && folderHasChildType(&f.Folder, "Folder") { + cluster, err := CreateClusterComputeResource(ctx, f, c.Name, c.Spec) if err != nil { r.Fault_ = Fault("", err) return r @@ -273,36 +367,45 @@ func hostsWithDatastore(hosts []types.ManagedObjectReference, path string) []typ } func (c *createVM) Run(task *Task) (types.AnyType, types.BaseMethodFault) { - vm, err := NewVirtualMachine(c.Folder.Self, &c.req.Config) + config := &c.req.Config + // escape special characters in vm name + if config.Name != escapeSpecialCharacters(config.Name) { + deepCopy(c.req.Config, config) + config.Name = escapeSpecialCharacters(config.Name) + } + + vm, err := NewVirtualMachine(c.ctx, c.Folder.Self, &c.req.Config) if err != nil { - c.Folder.removeChild(vm) return nil, err } vm.ResourcePool = &c.req.Pool if c.req.Host == nil { - var hosts []types.ManagedObjectReference + pool := c.ctx.Map.Get(c.req.Pool).(mo.Entity) + cr := c.ctx.Map.getEntityComputeResource(pool) - pool := Map.Get(c.req.Pool).(mo.Entity) + c.ctx.WithLock(cr, func() { + var hosts []types.ManagedObjectReference + switch cr := cr.(type) { + case *mo.ComputeResource: + hosts = cr.Host + case *ClusterComputeResource: + hosts = cr.Host + } - switch cr := Map.getEntityComputeResource(pool).(type) { - case *mo.ComputeResource: - hosts = cr.Host - case *ClusterComputeResource: - hosts = cr.Host - } - - hosts = hostsWithDatastore(hosts, c.req.Config.Files.VmPathName) - host := hosts[rand.Intn(len(hosts))] - vm.Runtime.Host = &host + hosts = hostsWithDatastore(hosts, c.req.Config.Files.VmPathName) + host := hosts[rand.Intn(len(hosts))] + vm.Runtime.Host = &host + }) } else { vm.Runtime.Host = c.req.Host } vm.Guest = &types.GuestInfo{ - ToolsStatus: types.VirtualMachineToolsStatusToolsNotInstalled, - ToolsVersion: "0", + ToolsStatus: types.VirtualMachineToolsStatusToolsNotInstalled, + ToolsVersion: "0", + ToolsRunningStatus: string(types.VirtualMachineToolsRunningStatusGuestToolsNotRunning), } vm.Summary.Guest = &types.VirtualMachineGuestSummary{ @@ -311,30 +414,30 @@ func (c *createVM) Run(task *Task) (types.AnyType, types.BaseMethodFault) { vm.Summary.Config.VmPathName = vm.Config.Files.VmPathName vm.Summary.Runtime.Host = vm.Runtime.Host - err = vm.create(&c.req.Config, c.register) + err = vm.create(c.ctx, &c.req.Config, c.register) if err != nil { - c.Folder.removeChild(vm) + folderRemoveChild(c.ctx, &c.Folder.Folder, vm) return nil, err } - host := Map.Get(*vm.Runtime.Host).(*HostSystem) - Map.AppendReference(host, &host.Vm, vm.Self) + host := c.ctx.Map.Get(*vm.Runtime.Host).(*HostSystem) + c.ctx.Map.AppendReference(c.ctx, host, &host.Vm, vm.Self) vm.EnvironmentBrowser = *hostParent(&host.HostSystem).EnvironmentBrowser for i := range vm.Datastore { - ds := Map.Get(vm.Datastore[i]).(*Datastore) - Map.AppendReference(ds, &ds.Vm, vm.Self) + ds := c.ctx.Map.Get(vm.Datastore[i]).(*Datastore) + c.ctx.Map.AppendReference(c.ctx, ds, &ds.Vm, vm.Self) } - pool := Map.Get(*vm.ResourcePool) + pool := c.ctx.Map.Get(*vm.ResourcePool) // This can be an internal call from VirtualApp.CreateChildVMTask, where pool is already locked. c.ctx.WithLock(pool, func() { - switch rp := pool.(type) { - case *ResourcePool: - rp.Vm = append(rp.Vm, vm.Self) - case *VirtualApp: + if rp, ok := asResourcePoolMO(pool); ok { rp.Vm = append(rp.Vm, vm.Self) } + if vapp, ok := pool.(*VirtualApp); ok { + vapp.Vm = append(vapp.Vm, vm.Self) + } }) event := vm.event() @@ -358,13 +461,17 @@ func (c *createVM) Run(task *Task) (types.AnyType, types.BaseMethodFault) { vm.RefreshStorageInfo(c.ctx, nil) + c.ctx.Map.Update(vm, []types.PropertyChange{ + {Name: "name", Val: c.req.Config.Name}, + }) + return vm.Reference(), nil } func (f *Folder) CreateVMTask(ctx *Context, c *types.CreateVM_Task) soap.HasFault { return &methods.CreateVM_TaskBody{ Res: &types.CreateVM_TaskResponse{ - Returnval: NewTask(&createVM{f, ctx, c, false}).Run(), + Returnval: NewTask(&createVM{f, ctx, c, false}).Run(ctx), }, } } @@ -387,7 +494,7 @@ func (c *registerVM) Run(task *Task) (types.AnyType, types.BaseMethodFault) { return nil, &types.InvalidArgument{InvalidProperty: "pool"} } - pool = hostParent(&Map.Get(*host).(*HostSystem).HostSystem).ResourcePool + pool = hostParent(&c.ctx.Map.Get(*host).(*HostSystem).HostSystem).ResourcePool } else { if pool == nil { return nil, &types.InvalidArgument{InvalidProperty: "pool"} @@ -398,11 +505,11 @@ func (c *registerVM) Run(task *Task) (types.AnyType, types.BaseMethodFault) { return nil, &types.InvalidArgument{InvalidProperty: "path"} } - s := Map.SearchIndex() + s := c.ctx.Map.SearchIndex() r := s.FindByDatastorePath(&types.FindByDatastorePath{ This: s.Reference(), Path: c.req.Path, - Datacenter: Map.getEntityDatacenter(c.Folder).Reference(), + Datacenter: c.ctx.Map.getEntityDatacenter(c.Folder).Reference(), }) if ref := r.(*methods.FindByDatastorePathBody).Res.Returnval; ref != nil { @@ -435,7 +542,7 @@ func (c *registerVM) Run(task *Task) (types.AnyType, types.BaseMethodFault) { }, }) - create.Run() + create.RunBlocking(c.ctx) if create.Info.Error != nil { return nil, create.Info.Error.Fault @@ -445,28 +552,26 @@ func (c *registerVM) Run(task *Task) (types.AnyType, types.BaseMethodFault) { } func (f *Folder) RegisterVMTask(ctx *Context, c *types.RegisterVM_Task) soap.HasFault { - ctx.Caller = &f.Self - return &methods.RegisterVM_TaskBody{ Res: &types.RegisterVM_TaskResponse{ - Returnval: NewTask(®isterVM{f, ctx, c}).Run(), + Returnval: NewTask(®isterVM{f, ctx, c}).Run(ctx), }, } } -func (f *Folder) MoveIntoFolderTask(c *types.MoveIntoFolder_Task) soap.HasFault { +func (f *Folder) MoveIntoFolderTask(ctx *Context, c *types.MoveIntoFolder_Task) soap.HasFault { task := CreateTask(f, "moveIntoFolder", func(t *Task) (types.AnyType, types.BaseMethodFault) { for _, ref := range c.List { - obj := Map.Get(ref).(mo.Entity) + obj := ctx.Map.Get(ref).(mo.Entity) - parent, ok := Map.Get(*(obj.Entity()).Parent).(*Folder) + parent, ok := ctx.Map.Get(*(obj.Entity()).Parent).(*Folder) - if !ok || !f.hasChildType(ref.Type) { + if !ok || !folderHasChildType(&f.Folder, ref.Type) { return nil, &types.NotSupported{} } - parent.removeChild(ref) - f.putChild(obj) + folderRemoveChild(ctx, &parent.Folder, ref) + folderPutChild(ctx, &f.Folder, obj) } return nil, nil @@ -474,25 +579,25 @@ func (f *Folder) MoveIntoFolderTask(c *types.MoveIntoFolder_Task) soap.HasFault return &methods.MoveIntoFolder_TaskBody{ Res: &types.MoveIntoFolder_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (f *Folder) CreateDVSTask(req *types.CreateDVS_Task) soap.HasFault { +func (f *Folder) CreateDVSTask(ctx *Context, req *types.CreateDVS_Task) soap.HasFault { task := CreateTask(f, "createDVS", func(t *Task) (types.AnyType, types.BaseMethodFault) { spec := req.Spec.ConfigSpec.GetDVSConfigSpec() dvs := &DistributedVirtualSwitch{} dvs.Name = spec.Name dvs.Entity().Name = dvs.Name - if Map.FindByName(dvs.Name, f.ChildEntity) != nil { + if ctx.Map.FindByName(dvs.Name, f.ChildEntity) != nil { return nil, &types.InvalidArgument{InvalidProperty: "name"} } - dvs.Uuid = uuid.New().String() + dvs.Uuid = newUUID(dvs.Name) - f.putChild(dvs) + folderPutChild(ctx, &f.Folder, dvs) dvs.Summary = types.DVSSummary{ Name: dvs.Name, @@ -530,7 +635,7 @@ func (f *Folder) CreateDVSTask(req *types.CreateDVS_Task) soap.HasFault { dvs.Config = configInfo if dvs.Summary.ProductInfo == nil { - product := Map.content().About + product := ctx.Map.content().About dvs.Summary.ProductInfo = &types.DistributedVirtualSwitchProductSpec{ Name: "DVS", Vendor: product.Vendor, @@ -540,13 +645,29 @@ func (f *Folder) CreateDVSTask(req *types.CreateDVS_Task) soap.HasFault { } } - dvs.AddDVPortgroupTask(&types.AddDVPortgroup_Task{ + dvs.AddDVPortgroupTask(ctx, &types.AddDVPortgroup_Task{ Spec: []types.DVPortgroupConfigSpec{{ - Name: dvs.Name + "-DVUplinks" + strings.TrimPrefix(dvs.Self.Value, "dvs"), + Name: dvs.Name + "-DVUplinks" + strings.TrimPrefix(dvs.Self.Value, "dvs"), + Type: string(types.DistributedVirtualPortgroupPortgroupTypeEarlyBinding), + NumPorts: 1, DefaultPortConfig: &types.VMwareDVSPortSetting{ Vlan: &types.VmwareDistributedVirtualSwitchTrunkVlanSpec{ VlanId: []types.NumericRange{{Start: 0, End: 4094}}, }, + UplinkTeamingPolicy: &types.VmwareUplinkPortTeamingPolicy{ + Policy: &types.StringPolicy{ + Value: "loadbalance_srcid", + }, + ReversePolicy: &types.BoolPolicy{ + Value: types.NewBool(true), + }, + NotifySwitches: &types.BoolPolicy{ + Value: types.NewBool(true), + }, + RollingOrder: &types.BoolPolicy{ + Value: types.NewBool(true), + }, + }, }, }}, }) @@ -556,16 +677,16 @@ func (f *Folder) CreateDVSTask(req *types.CreateDVS_Task) soap.HasFault { return &methods.CreateDVS_TaskBody{ Res: &types.CreateDVS_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (f *Folder) RenameTask(r *types.Rename_Task) soap.HasFault { - return RenameTask(f, r) +func (f *Folder) RenameTask(ctx *Context, r *types.Rename_Task) soap.HasFault { + return RenameTask(ctx, f, r) } -func (f *Folder) DestroyTask(req *types.Destroy_Task) soap.HasFault { +func (f *Folder) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { type destroyer interface { mo.Reference DestroyTask(*types.Destroy_Task) soap.HasFault @@ -574,18 +695,19 @@ func (f *Folder) DestroyTask(req *types.Destroy_Task) soap.HasFault { task := CreateTask(f, "destroy", func(*Task) (types.AnyType, types.BaseMethodFault) { // Attempt to destroy all children for _, c := range f.ChildEntity { - obj, ok := Map.Get(c).(destroyer) + obj, ok := ctx.Map.Get(c).(destroyer) if !ok { continue } var fault types.BaseMethodFault - Map.WithLock(obj, func() { + ctx.WithLock(obj, func() { id := obj.DestroyTask(&types.Destroy_Task{ This: c, }).(*methods.Destroy_TaskBody).Res.Returnval - t := Map.Get(id).(*Task) + t := ctx.Map.Get(id).(*Task) + t.Wait() if t.Info.Error != nil { fault = t.Info.Error.Fault // For example, can't destroy a powered on VM } @@ -596,13 +718,159 @@ func (f *Folder) DestroyTask(req *types.Destroy_Task) soap.HasFault { } // Remove the folder itself - Map.Get(*f.Parent).(*Folder).removeChild(f.Self) + folderRemoveChild(ctx, &ctx.Map.Get(*f.Parent).(*Folder).Folder, f.Self) return nil, nil }) return &methods.Destroy_TaskBody{ Res: &types.Destroy_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } + +func (f *Folder) PlaceVmsXCluster(ctx *Context, req *types.PlaceVmsXCluster) soap.HasFault { + body := new(methods.PlaceVmsXClusterBody) + + // Reject the request if it is against any folder other than the root folder. + if req.This != ctx.Map.content().RootFolder { + body.Fault_ = Fault("", new(types.InvalidRequest)) + return body + } + + pools := req.PlacementSpec.ResourcePools + specs := req.PlacementSpec.VmPlacementSpecs + + if len(pools) == 0 { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "resourcePools"}) + return body + } + + // Do not allow duplicate clusters. + clusters := map[mo.Reference]struct{}{} + for _, obj := range pools { + o := ctx.Map.Get(obj) + pool, ok := o.(*ResourcePool) + if !ok { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "resourcePool"}) + return body + } + if _, exists := clusters[pool.Owner]; exists { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "clusters"}) + return body + } + clusters[pool.Owner] = struct{}{} + } + + // MVP: Only a single VM is supported. + if len(specs) != 1 { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "vmPlacementSpecs"}) + return body + } + + for _, spec := range specs { + if spec.ConfigSpec.Name == "" { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "configSpec.name"}) + return body + } + } + + body.Res = new(types.PlaceVmsXClusterResponse) + hostRequired := req.PlacementSpec.HostRecommRequired != nil && *req.PlacementSpec.HostRecommRequired + datastoreRequired := req.PlacementSpec.DatastoreRecommRequired != nil && *req.PlacementSpec.DatastoreRecommRequired + + for _, spec := range specs { + pool := ctx.Map.Get(pools[rand.Intn(len(pools))]).(*ResourcePool) + cluster := ctx.Map.Get(pool.Owner).(*ClusterComputeResource) + + if len(cluster.Host) == 0 { + faults := types.PlaceVmsXClusterResultPlacementFaults{ + VmName: spec.ConfigSpec.Name, + ResourcePool: pool.Self, + Faults: []types.LocalizedMethodFault{ + { + Fault: &types.GenericDrsFault{}, + }, + }, + } + body.Res.Returnval.Faults = append(body.Res.Returnval.Faults, faults) + } else { + var configSpec *types.VirtualMachineConfigSpec + + res := types.ClusterRecommendation{ + Key: "1", + Type: "V1", + Time: time.Now(), + Rating: 1, + Reason: string(types.RecommendationReasonCodeXClusterPlacement), + ReasonText: string(types.RecommendationReasonCodeXClusterPlacement), + Target: &cluster.Self, + } + + placementAction := types.ClusterClusterInitialPlacementAction{ + Pool: pool.Self, + } + + if hostRequired { + randomHost := cluster.Host[rand.Intn(len(cluster.Host))] + placementAction.TargetHost = &randomHost + } + + if datastoreRequired { + configSpec = &spec.ConfigSpec + + // TODO: This is just an initial implementation aimed at returning some data but it is not + // necessarily fully consistent, like we should ensure the host, if also required, has the + // datastore mounted. + ds := ctx.Map.Get(cluster.Datastore[rand.Intn(len(cluster.Datastore))]).(*Datastore) + + if configSpec.Files == nil { + configSpec.Files = new(types.VirtualMachineFileInfo) + } + configSpec.Files.VmPathName = fmt.Sprintf("[%[1]s] %[2]s/%[2]s.vmx", ds.Name, spec.ConfigSpec.Name) + + for _, change := range configSpec.DeviceChange { + dspec := change.GetVirtualDeviceConfigSpec() + + if dspec.FileOperation != types.VirtualDeviceConfigSpecFileOperationCreate { + continue + } + + switch dspec.Operation { + case types.VirtualDeviceConfigSpecOperationAdd: + device := dspec.Device + d := device.GetVirtualDevice() + + switch device.(type) { + case *types.VirtualDisk: + switch b := d.Backing.(type) { + case types.BaseVirtualDeviceFileBackingInfo: + info := b.GetVirtualDeviceFileBackingInfo() + info.Datastore = types.NewReference(ds.Reference()) + + var dsPath object.DatastorePath + if dsPath.FromString(info.FileName) { + dsPath.Datastore = ds.Name + info.FileName = dsPath.String() + } + } + } + } + } + + placementAction.ConfigSpec = configSpec + } + + res.Action = append(res.Action, &placementAction) + + body.Res.Returnval.PlacementInfos = append(body.Res.Returnval.PlacementInfos, + types.PlaceVmsXClusterResultPlacementInfo{ + VmName: spec.ConfigSpec.Name, + Recommendation: res, + }, + ) + } + } + + return body +} diff --git a/vendor/github.com/vmware/govmomi/simulator/guest_operations_manager.go b/vendor/github.com/vmware/govmomi/simulator/guest_operations_manager.go new file mode 100644 index 00000000000..780f44a040a --- /dev/null +++ b/vendor/github.com/vmware/govmomi/simulator/guest_operations_manager.go @@ -0,0 +1,457 @@ +/* +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 simulator + +import ( + "bufio" + "fmt" + "net/url" + "strings" + "syscall" + "time" + + "github.com/vmware/govmomi/toolbox/process" + "github.com/vmware/govmomi/toolbox/vix" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type GuestOperationsManager struct { + mo.GuestOperationsManager +} + +func (m *GuestOperationsManager) init(r *Registry) { + fm := new(GuestFileManager) + if m.FileManager == nil { + m.FileManager = &types.ManagedObjectReference{ + Type: "GuestFileManager", + Value: "guestOperationsFileManager", + } + } + fm.Self = *m.FileManager + r.Put(fm) + + pm := new(GuestProcessManager) + if m.ProcessManager == nil { + m.ProcessManager = &types.ManagedObjectReference{ + Type: "GuestProcessManager", + Value: "guestOperationsProcessManager", + } + } + pm.Self = *m.ProcessManager + pm.Manager = process.NewManager() + r.Put(pm) +} + +type GuestFileManager struct { + mo.GuestFileManager +} + +func guestURL(ctx *Context, vm *VirtualMachine, path string) string { + return (&url.URL{ + Scheme: ctx.svc.Listen.Scheme, + Host: "*", // See guest.FileManager.TransferURL + Path: guestPrefix + strings.TrimPrefix(path, "/"), + RawQuery: url.Values{ + "id": []string{vm.run.id}, + "token": []string{ctx.Session.Key}, + }.Encode(), + }).String() +} + +func (m *GuestFileManager) InitiateFileTransferToGuest(ctx *Context, req *types.InitiateFileTransferToGuest) soap.HasFault { + body := new(methods.InitiateFileTransferToGuestBody) + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + err := vm.run.prepareGuestOperation(vm, req.Auth) + if err != nil { + body.Fault_ = Fault("", err) + return body + } + + body.Res = &types.InitiateFileTransferToGuestResponse{ + Returnval: guestURL(ctx, vm, req.GuestFilePath), + } + + return body +} + +func (m *GuestFileManager) InitiateFileTransferFromGuest(ctx *Context, req *types.InitiateFileTransferFromGuest) soap.HasFault { + body := new(methods.InitiateFileTransferFromGuestBody) + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + err := vm.run.prepareGuestOperation(vm, req.Auth) + if err != nil { + body.Fault_ = Fault("", err) + return body + } + + body.Res = &types.InitiateFileTransferFromGuestResponse{ + Returnval: types.FileTransferInformation{ + Attributes: nil, // TODO + Size: 0, // TODO + Url: guestURL(ctx, vm, req.GuestFilePath), + }, + } + + return body +} + +type GuestProcessManager struct { + mo.GuestProcessManager + *process.Manager +} + +func (m *GuestProcessManager) StartProgramInGuest(ctx *Context, req *types.StartProgramInGuest) soap.HasFault { + body := new(methods.StartProgramInGuestBody) + + spec := req.Spec.(*types.GuestProgramSpec) + auth := req.Auth.(*types.NamePasswordAuthentication) + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + fault := vm.run.prepareGuestOperation(vm, auth) + if fault != nil { + body.Fault_ = Fault("", fault) + } + + args := []string{"exec"} + + if spec.WorkingDirectory != "" { + args = append(args, "-w", spec.WorkingDirectory) + } + + for _, e := range spec.EnvVariables { + args = append(args, "-e", e) + } + + args = append(args, vm.run.id, spec.ProgramPath, spec.Arguments) + + spec.ProgramPath = "docker" + spec.Arguments = strings.Join(args, " ") + + start := &vix.StartProgramRequest{ + ProgramPath: spec.ProgramPath, + Arguments: spec.Arguments, + } + + proc := process.New() + proc.Owner = auth.Username + + pid, err := m.Start(start, proc) + if err != nil { + panic(err) // only happens if LookPath("docker") fails, which it should't at this point + } + + body.Res = &types.StartProgramInGuestResponse{ + Returnval: pid, + } + + return body +} + +func (m *GuestProcessManager) ListProcessesInGuest(ctx *Context, req *types.ListProcessesInGuest) soap.HasFault { + body := &methods.ListProcessesInGuestBody{ + Res: new(types.ListProcessesInGuestResponse), + } + + procs := m.List(req.Pids) + + for _, proc := range procs { + var end *time.Time + if proc.EndTime != 0 { + end = types.NewTime(time.Unix(proc.EndTime, 0)) + } + + body.Res.Returnval = append(body.Res.Returnval, types.GuestProcessInfo{ + Name: proc.Name, + Pid: proc.Pid, + Owner: proc.Owner, + CmdLine: proc.Name + " " + proc.Args, + StartTime: time.Unix(proc.StartTime, 0), + EndTime: end, + ExitCode: proc.ExitCode, + }) + } + + return body +} + +func (m *GuestProcessManager) TerminateProcessInGuest(ctx *Context, req *types.TerminateProcessInGuest) soap.HasFault { + body := new(methods.TerminateProcessInGuestBody) + + if m.Kill(req.Pid) { + body.Res = new(types.TerminateProcessInGuestResponse) + } else { + body.Fault_ = Fault("", &types.GuestProcessNotFound{Pid: req.Pid}) + } + + return body +} + +func (m *GuestFileManager) mktemp(ctx *Context, req *types.CreateTemporaryFileInGuest, dir bool) (string, types.BaseMethodFault) { + args := []string{"mktemp", fmt.Sprintf("--tmpdir=%s", req.DirectoryPath), req.Prefix + "vcsim-XXXXX" + req.Suffix} + if dir { + args = append(args, "-d") + } + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + return vm.run.exec(ctx, vm, req.Auth, args) +} + +func (m *GuestFileManager) CreateTemporaryFileInGuest(ctx *Context, req *types.CreateTemporaryFileInGuest) soap.HasFault { + body := new(methods.CreateTemporaryFileInGuestBody) + + res, fault := m.mktemp(ctx, req, false) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = &types.CreateTemporaryFileInGuestResponse{Returnval: res} + + return body +} + +func (m *GuestFileManager) CreateTemporaryDirectoryInGuest(ctx *Context, req *types.CreateTemporaryDirectoryInGuest) soap.HasFault { + body := new(methods.CreateTemporaryDirectoryInGuestBody) + + dir := types.CreateTemporaryFileInGuest(*req) + res, fault := m.mktemp(ctx, &dir, true) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = &types.CreateTemporaryDirectoryInGuestResponse{Returnval: res} + + return body +} + +func listFiles(req *types.ListFilesInGuest) []string { + args := []string{"find", req.FilePath} + if req.MatchPattern != "" { + args = append(args, "-name", req.MatchPattern) + } + return append(args, "-maxdepth", "1", "-exec", "stat", "-c", "%s %u %g %f %X %Y %n", "{}", "+") +} + +func toFileInfo(s string) []types.GuestFileInfo { + var res []types.GuestFileInfo + + scanner := bufio.NewScanner(strings.NewReader(s)) + + for scanner.Scan() { + var mode, atime, mtime int64 + attr := &types.GuestPosixFileAttributes{OwnerId: new(int32), GroupId: new(int32)} + info := types.GuestFileInfo{Attributes: attr} + + _, err := fmt.Sscanf(scanner.Text(), "%d %d %d %x %d %d %s", + &info.Size, attr.OwnerId, attr.GroupId, &mode, &atime, &mtime, &info.Path) + if err != nil { + panic(err) + } + + attr.AccessTime = types.NewTime(time.Unix(atime, 0)) + attr.ModificationTime = types.NewTime(time.Unix(mtime, 0)) + attr.Permissions = mode & 0777 + + switch mode & syscall.S_IFMT { + case syscall.S_IFDIR: + info.Type = string(types.GuestFileTypeDirectory) + case syscall.S_IFLNK: + info.Type = string(types.GuestFileTypeSymlink) + default: + info.Type = string(types.GuestFileTypeFile) + } + + res = append(res, info) + } + + return res +} + +func (m *GuestFileManager) ListFilesInGuest(ctx *Context, req *types.ListFilesInGuest) soap.HasFault { + body := new(methods.ListFilesInGuestBody) + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + if req.FilePath == "" { + body.Fault_ = Fault("", new(types.InvalidArgument)) + return body + } + + res, fault := vm.run.exec(ctx, vm, req.Auth, listFiles(req)) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = new(types.ListFilesInGuestResponse) + body.Res.Returnval.Files = toFileInfo(res) + + return body +} + +func (m *GuestFileManager) DeleteFileInGuest(ctx *Context, req *types.DeleteFileInGuest) soap.HasFault { + body := new(methods.DeleteFileInGuestBody) + + args := []string{"rm", req.FilePath} + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + _, fault := vm.run.exec(ctx, vm, req.Auth, args) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = new(types.DeleteFileInGuestResponse) + + return body +} + +func (m *GuestFileManager) DeleteDirectoryInGuest(ctx *Context, req *types.DeleteDirectoryInGuest) soap.HasFault { + body := new(methods.DeleteDirectoryInGuestBody) + + args := []string{"rmdir", req.DirectoryPath} + if req.Recursive { + args = []string{"rm", "-rf", req.DirectoryPath} + } + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + _, fault := vm.run.exec(ctx, vm, req.Auth, args) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = new(types.DeleteDirectoryInGuestResponse) + + return body +} + +func (m *GuestFileManager) MakeDirectoryInGuest(ctx *Context, req *types.MakeDirectoryInGuest) soap.HasFault { + body := new(methods.MakeDirectoryInGuestBody) + + args := []string{"mkdir", req.DirectoryPath} + if req.CreateParentDirectories { + args = []string{"mkdir", "-p", req.DirectoryPath} + } + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + _, fault := vm.run.exec(ctx, vm, req.Auth, args) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = new(types.MakeDirectoryInGuestResponse) + + return body +} + +func (m *GuestFileManager) MoveFileInGuest(ctx *Context, req *types.MoveFileInGuest) soap.HasFault { + body := new(methods.MoveFileInGuestBody) + + args := []string{"mv"} + if !req.Overwrite { + args = append(args, "-n") + } + args = append(args, req.SrcFilePath, req.DstFilePath) + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + _, fault := vm.run.exec(ctx, vm, req.Auth, args) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = new(types.MoveFileInGuestResponse) + + return body +} + +func (m *GuestFileManager) MoveDirectoryInGuest(ctx *Context, req *types.MoveDirectoryInGuest) soap.HasFault { + body := new(methods.MoveDirectoryInGuestBody) + + args := []string{"mv", req.SrcDirectoryPath, req.DstDirectoryPath} + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + _, fault := vm.run.exec(ctx, vm, req.Auth, args) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + + body.Res = new(types.MoveDirectoryInGuestResponse) + + return body +} + +func (m *GuestFileManager) ChangeFileAttributesInGuest(ctx *Context, req *types.ChangeFileAttributesInGuest) soap.HasFault { + body := new(methods.ChangeFileAttributesInGuestBody) + + vm := ctx.Map.Get(req.Vm).(*VirtualMachine) + + attr, ok := req.FileAttributes.(*types.GuestPosixFileAttributes) + if !ok { + body.Fault_ = Fault("", new(types.OperationNotSupportedByGuest)) + return body + } + + if attr.Permissions != 0 { + args := []string{"chmod", fmt.Sprintf("%#o", attr.Permissions), req.GuestFilePath} + + _, fault := vm.run.exec(ctx, vm, req.Auth, args) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + } + + change := []struct { + cmd string + id *int32 + }{ + {"chown", attr.OwnerId}, + {"chgrp", attr.GroupId}, + } + + for _, c := range change { + if c.id != nil { + args := []string{c.cmd, fmt.Sprintf("%d", *c.id), req.GuestFilePath} + + _, fault := vm.run.exec(ctx, vm, req.Auth, args) + if fault != nil { + body.Fault_ = Fault("", fault) + return body + } + } + } + + body.Res = new(types.ChangeFileAttributesInGuestResponse) + + return body +} diff --git a/vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go b/vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go index 6dd5a9956de..185ebbd8533 100644 --- a/vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go +++ b/vendor/github.com/vmware/govmomi/simulator/host_datastore_browser.go @@ -18,7 +18,6 @@ package simulator import ( "io/ioutil" - "log" "os" "path" "strings" @@ -128,12 +127,8 @@ func (s *searchDatastore) queryMatch(file os.FileInfo) bool { } case *types.VmDiskFileQuery: if ext == ".vmdk" { - if strings.HasSuffix(name, "-flat.vmdk") { - // only matches the descriptor, not the backing file(s) - return false - } // TODO: check Filter and Details fields - return true + return !strings.HasSuffix(name, "-flat.vmdk") } case *types.VmLogFileQuery: if ext == ".log" { @@ -156,7 +151,7 @@ func (s *searchDatastore) queryMatch(file os.FileInfo) bool { func (s *searchDatastore) search(ds *types.ManagedObjectReference, folder string, dir string) error { files, err := ioutil.ReadDir(dir) if err != nil { - log.Printf("search %s: %s", dir, err) + tracef("search %s: %s", dir, err) return err } @@ -199,8 +194,12 @@ func (s *searchDatastore) Run(task *Task) (types.AnyType, types.BaseMethodFault) } ds := ref.(*Datastore) - task.Info.Entity = &ds.Self // TODO: CreateTask() should require mo.Entity, rather than mo.Reference - task.Info.EntityName = ds.Name + + isolatedLockContext := &Context{} // we don't need/want to share the task lock + Map.WithLock(isolatedLockContext, task, func() { + task.Info.Entity = &ds.Self // TODO: CreateTask() should require mo.Entity, rather than mo.Reference + task.Info.EntityName = ds.Name + }) dir := path.Join(ds.Info.GetDatastoreInfo().Url, p.Path) @@ -226,7 +225,7 @@ func (s *searchDatastore) Run(task *Task) (types.AnyType, types.BaseMethodFault) return s.res[0], nil } -func (b *HostDatastoreBrowser) SearchDatastoreTask(s *types.SearchDatastore_Task) soap.HasFault { +func (b *HostDatastoreBrowser) SearchDatastoreTask(ctx *Context, s *types.SearchDatastore_Task) soap.HasFault { task := NewTask(&searchDatastore{ HostDatastoreBrowser: b, DatastorePath: s.DatastorePath, @@ -235,12 +234,12 @@ func (b *HostDatastoreBrowser) SearchDatastoreTask(s *types.SearchDatastore_Task return &methods.SearchDatastore_TaskBody{ Res: &types.SearchDatastore_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (b *HostDatastoreBrowser) SearchDatastoreSubFoldersTask(s *types.SearchDatastoreSubFolders_Task) soap.HasFault { +func (b *HostDatastoreBrowser) SearchDatastoreSubFoldersTask(ctx *Context, s *types.SearchDatastoreSubFolders_Task) soap.HasFault { task := NewTask(&searchDatastore{ HostDatastoreBrowser: b, DatastorePath: s.DatastorePath, @@ -250,7 +249,7 @@ func (b *HostDatastoreBrowser) SearchDatastoreSubFoldersTask(s *types.SearchData return &methods.SearchDatastoreSubFolders_TaskBody{ Res: &types.SearchDatastoreSubFolders_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } diff --git a/vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go b/vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go index e6a2dcf3080..da6436917d0 100644 --- a/vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go +++ b/vendor/github.com/vmware/govmomi/simulator/host_datastore_system.go @@ -20,6 +20,7 @@ import ( "os" "path" + "github.com/vmware/govmomi/units" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/soap" @@ -32,12 +33,12 @@ type HostDatastoreSystem struct { Host *mo.HostSystem } -func (dss *HostDatastoreSystem) add(ds *Datastore) *soap.Fault { +func (dss *HostDatastoreSystem) add(ctx *Context, ds *Datastore) *soap.Fault { info := ds.Info.GetDatastoreInfo() info.Name = ds.Name - if e := Map.FindByName(ds.Name, dss.Datastore); e != nil { + if e := ctx.Map.FindByName(ds.Name, dss.Datastore); e != nil { return Fault(e.Reference().Value, &types.DuplicateName{ Name: ds.Name, Object: e.Reference(), @@ -58,37 +59,65 @@ func (dss *HostDatastoreSystem) add(ds *Datastore) *soap.Fault { } } - folder := Map.getEntityFolder(dss.Host, "datastore") - ds.Self.Type = typeName(ds) - // Datastore is the only type where create methods do not include the parent (Folder in this case), - // but we need the moref to be unique per DC/datastoreFolder, but not per-HostSystem. - ds.Self.Value += "@" + folder.Self.Value - // TODO: name should be made unique in the case of Local ds type + folder := ctx.Map.getEntityFolder(dss.Host, "datastore") + + found := false + if e := ctx.Map.FindByName(ds.Name, folder.ChildEntity); e != nil { + if e.Reference().Type != "Datastore" { + return Fault(e.Reference().Value, &types.DuplicateName{ + Name: ds.Name, + Object: e.Reference(), + }) + } + + // if datastore already exists, use current reference + found = true + ds.Self = e.Reference() + } else { + // put datastore to folder and generate reference + folderPutChild(ctx, folder, ds) + } ds.Summary.Datastore = &ds.Self ds.Summary.Name = ds.Name ds.Summary.Url = info.Url + ds.Capability = types.DatastoreCapability{ + DirectoryHierarchySupported: true, + RawDiskMappingsSupported: false, + PerFileThinProvisioningSupported: true, + StorageIORMSupported: types.NewBool(true), + NativeSnapshotSupported: types.NewBool(false), + TopLevelDirectoryCreateSupported: types.NewBool(true), + SeSparseSupported: types.NewBool(true), + } dss.Datastore = append(dss.Datastore, ds.Self) dss.Host.Datastore = dss.Datastore parent := hostParent(dss.Host) - Map.AddReference(parent, &parent.Datastore, ds.Self) + ctx.Map.AddReference(ctx, parent, &parent.Datastore, ds.Self) - browser := &HostDatastoreBrowser{} - browser.Datastore = dss.Datastore - ds.Browser = Map.Put(browser).Reference() + // NOTE: browser must be created after ds is appended to dss.Datastore + if !found { + browser := &HostDatastoreBrowser{} + browser.Datastore = dss.Datastore + ds.Browser = ctx.Map.Put(browser).Reference() - folder.putChild(ds) + ds.Summary.Capacity = int64(units.TB * 10) + ds.Summary.FreeSpace = ds.Summary.Capacity + + info.FreeSpace = ds.Summary.FreeSpace + info.MaxMemoryFileSize = ds.Summary.Capacity + info.MaxFileSize = ds.Summary.Capacity + } return nil } -func (dss *HostDatastoreSystem) CreateLocalDatastore(c *types.CreateLocalDatastore) soap.HasFault { +func (dss *HostDatastoreSystem) CreateLocalDatastore(ctx *Context, c *types.CreateLocalDatastore) soap.HasFault { r := &methods.CreateLocalDatastoreBody{} ds := &Datastore{} ds.Name = c.Name - ds.Self.Value = c.Path ds.Info = &types.LocalDatastoreInfo{ DatastoreInfo: types.DatastoreInfo{ @@ -98,9 +127,11 @@ func (dss *HostDatastoreSystem) CreateLocalDatastore(c *types.CreateLocalDatasto Path: c.Path, } - ds.Summary.Type = "local" + ds.Summary.Type = string(types.HostFileSystemVolumeFileSystemTypeOTHER) + ds.Summary.MaintenanceMode = string(types.DatastoreSummaryMaintenanceModeStateNormal) + ds.Summary.Accessible = true - if err := dss.add(ds); err != nil { + if err := dss.add(ctx, ds); err != nil { r.Fault_ = err return r } @@ -123,12 +154,27 @@ func (dss *HostDatastoreSystem) CreateLocalDatastore(c *types.CreateLocalDatasto return r } -func (dss *HostDatastoreSystem) CreateNasDatastore(c *types.CreateNasDatastore) soap.HasFault { +func (dss *HostDatastoreSystem) CreateNasDatastore(ctx *Context, c *types.CreateNasDatastore) soap.HasFault { r := &methods.CreateNasDatastoreBody{} + // validate RemoteHost and RemotePath are specified + if c.Spec.RemoteHost == "" { + r.Fault_ = Fault( + "A specified parameter was not correct: Spec.RemoteHost", + &types.InvalidArgument{InvalidProperty: "RemoteHost"}, + ) + return r + } + if c.Spec.RemotePath == "" { + r.Fault_ = Fault( + "A specified parameter was not correct: Spec.RemotePath", + &types.InvalidArgument{InvalidProperty: "RemotePath"}, + ) + return r + } + ds := &Datastore{} ds.Name = path.Base(c.Spec.LocalPath) - ds.Self.Value = c.Spec.RemoteHost + ":" + c.Spec.RemotePath ds.Info = &types.NasDatastoreInfo{ DatastoreInfo: types.DatastoreInfo{ @@ -145,8 +191,10 @@ func (dss *HostDatastoreSystem) CreateNasDatastore(c *types.CreateNasDatastore) } ds.Summary.Type = c.Spec.Type + ds.Summary.MaintenanceMode = string(types.DatastoreSummaryMaintenanceModeStateNormal) + ds.Summary.Accessible = true - if err := dss.add(ds); err != nil { + if err := dss.add(ctx, ds); err != nil { r.Fault_ = err return r } diff --git a/vendor/github.com/vmware/govmomi/simulator/host_local_account_manager.go b/vendor/github.com/vmware/govmomi/simulator/host_local_account_manager.go index 0d463310569..993e3fe8790 100644 --- a/vendor/github.com/vmware/govmomi/simulator/host_local_account_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/host_local_account_manager.go @@ -17,7 +17,6 @@ limitations under the License. package simulator import ( - "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/soap" @@ -30,13 +29,6 @@ type HostLocalAccountManager struct { mo.HostLocalAccountManager } -func NewHostLocalAccountManager(ref types.ManagedObjectReference) object.Reference { - m := &HostLocalAccountManager{} - m.Self = ref - - return m -} - func (h *HostLocalAccountManager) CreateUser(req *types.CreateUser) soap.HasFault { spec := req.User.GetHostAccountSpec() userDirectory := Map.UserDirectory() diff --git a/vendor/github.com/vmware/govmomi/simulator/host_network_system.go b/vendor/github.com/vmware/govmomi/simulator/host_network_system.go index 64a2bd759c6..4afdda0a16b 100644 --- a/vendor/github.com/vmware/govmomi/simulator/host_network_system.go +++ b/vendor/github.com/vmware/govmomi/simulator/host_network_system.go @@ -27,6 +27,8 @@ type HostNetworkSystem struct { mo.HostNetworkSystem Host *mo.HostSystem + + types.QueryNetworkHintResponse } func NewHostNetworkSystem(host *mo.HostSystem) *HostNetworkSystem { @@ -40,11 +42,22 @@ func NewHostNetworkSystem(host *mo.HostSystem) *HostNetworkSystem { Portgroup: []string{"VM Network"}, }, }, + Portgroup: host.Config.Network.Portgroup, }, }, } } +func (s *HostNetworkSystem) init(r *Registry) { + for _, obj := range r.objects { + if h, ok := obj.(*HostSystem); ok { + if h.ConfigManager.NetworkSystem.Value == s.Self.Value { + s.Host = &h.HostSystem + } + } + } +} + func (s *HostNetworkSystem) folder() *Folder { f := Map.getEntityDatacenter(s.Host).NetworkFolder return Map.Get(f).(*Folder) @@ -87,7 +100,7 @@ func (s *HostNetworkSystem) RemoveVirtualSwitch(c *types.RemoveVirtualSwitch) so return r } -func (s *HostNetworkSystem) AddPortGroup(c *types.AddPortGroup) soap.HasFault { +func (s *HostNetworkSystem) AddPortGroup(ctx *Context, c *types.AddPortGroup) soap.HasFault { var vswitch *types.HostVirtualSwitch r := &methods.AddPortGroupBody{} @@ -115,7 +128,7 @@ func (s *HostNetworkSystem) AddPortGroup(c *types.AddPortGroup) soap.HasFault { folder := s.folder() - if obj := Map.FindByName(c.Portgrp.Name, folder.ChildEntity); obj != nil { + if obj := ctx.Map.FindByName(c.Portgrp.Name, folder.ChildEntity); obj != nil { r.Fault_ = Fault("", &types.DuplicateName{ Name: c.Portgrp.Name, Object: obj.Reference(), @@ -124,15 +137,22 @@ func (s *HostNetworkSystem) AddPortGroup(c *types.AddPortGroup) soap.HasFault { return r } - folder.putChild(network) + folderPutChild(ctx, &folder.Folder, network) vswitch.Portgroup = append(vswitch.Portgroup, c.Portgrp.Name) + + s.NetworkInfo.Portgroup = append(s.NetworkInfo.Portgroup, types.HostPortGroup{ + Key: "key-vim.host.PortGroup-" + c.Portgrp.Name, + Port: nil, + Spec: c.Portgrp, + }) + r.Res = &types.AddPortGroupResponse{} return r } -func (s *HostNetworkSystem) RemovePortGroup(c *types.RemovePortGroup) soap.HasFault { +func (s *HostNetworkSystem) RemovePortGroup(ctx *Context, c *types.RemovePortGroup) soap.HasFault { var vswitch *types.HostVirtualSwitch r := &methods.RemovePortGroupBody{} @@ -152,8 +172,15 @@ func (s *HostNetworkSystem) RemovePortGroup(c *types.RemovePortGroup) soap.HasFa } folder := s.folder() - e := Map.FindByName(c.PgName, folder.ChildEntity) - folder.removeChild(e.Reference()) + e := ctx.Map.FindByName(c.PgName, folder.ChildEntity) + folderRemoveChild(ctx, &folder.Folder, e.Reference()) + + for i, pg := range s.NetworkInfo.Portgroup { + if pg.Spec.Name == c.PgName { + var portgroup = s.NetworkInfo.Portgroup + s.NetworkInfo.Portgroup = append(portgroup[:i], portgroup[i+1:]...) + } + } r.Res = &types.RemovePortGroupResponse{} @@ -169,3 +196,11 @@ func (s *HostNetworkSystem) UpdateNetworkConfig(req *types.UpdateNetworkConfig) }, } } + +func (s *HostNetworkSystem) QueryNetworkHint(req *types.QueryNetworkHint) soap.HasFault { + return &methods.QueryNetworkHintBody{ + Res: &types.QueryNetworkHintResponse{ + Returnval: s.QueryNetworkHintResponse.Returnval, + }, + } +} diff --git a/vendor/github.com/vmware/govmomi/simulator/host_storage_system.go b/vendor/github.com/vmware/govmomi/simulator/host_storage_system.go new file mode 100644 index 00000000000..da2fd528c2f --- /dev/null +++ b/vendor/github.com/vmware/govmomi/simulator/host_storage_system.go @@ -0,0 +1,134 @@ +/* +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 simulator + +import ( + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type HostStorageSystem struct { + mo.HostStorageSystem + + Host *mo.HostSystem + HBA []types.BaseHostHostBusAdapter +} + +func NewHostStorageSystem(h *mo.HostSystem) *HostStorageSystem { + s := &HostStorageSystem{Host: h} + + s.StorageDeviceInfo = &esx.HostStorageDeviceInfo + + s.HBA = fibreChannelHBA + + return s +} + +// RescanAllHba swaps HostStorageSystem.HBA and StorageDeviceInfo.HostBusAdapter. +// This allows testing HBA with and without Fibre Channel data. +func (s *HostStorageSystem) RescanAllHba(ctx *Context, _ *types.RescanAllHba) soap.HasFault { + hba := s.StorageDeviceInfo.HostBusAdapter + s.StorageDeviceInfo.HostBusAdapter = s.HBA + s.HBA = hba + + ctx.WithLock(s.Host, func() { + s.Host.Config.StorageDevice.HostBusAdapter = s.StorageDeviceInfo.HostBusAdapter + }) + + return &methods.RescanAllHbaBody{ + Res: new(types.RescanAllHbaResponse), + } +} + +func (s *HostStorageSystem) RescanVmfs(*Context, *types.RescanVmfs) soap.HasFault { + return &methods.RescanVmfsBody{Res: new(types.RescanVmfsResponse)} +} + +func (s *HostStorageSystem) RefreshStorageSystem(*Context, *types.RefreshStorageSystem) soap.HasFault { + return &methods.RefreshStorageSystemBody{Res: new(types.RefreshStorageSystemResponse)} +} + +// HBA with FibreChannel data, see RescanAllHba() +var fibreChannelHBA = []types.BaseHostHostBusAdapter{ + &types.HostBlockHba{ + HostHostBusAdapter: types.HostHostBusAdapter{ + Key: "key-vim.host.BlockHba-vmhba0", + Device: "vmhba0", + Bus: 0, + Status: "unknown", + Model: "Lewisburg SATA AHCI Controller", + Driver: "vmw_ahci", + Pci: "0000:00:11.5", + }, + }, + &types.HostBlockHba{ + HostHostBusAdapter: types.HostHostBusAdapter{ + Key: "key-vim.host.BlockHba-vmhba1", + Device: "vmhba1", + Bus: 0, + Status: "unknown", + Model: "Lewisburg SATA AHCI Controller", + Driver: "vmw_ahci", + Pci: "0000:00:17.0", + }, + }, + &types.HostFibreChannelHba{ + HostHostBusAdapter: types.HostHostBusAdapter{ + Key: "key-vim.host.FibreChannelHba-vmhba2", + Device: "vmhba2", + Bus: 59, + Status: "online", + Model: "Emulex LightPulse LPe32000 PCIe Fibre Channel Adapter", + Driver: "lpfc", + Pci: "0000:3b:00.0", + }, + PortWorldWideName: 1152922127287604726, + NodeWorldWideName: 2305843631894451702, + PortType: "unknown", + Speed: 16, + }, + &types.HostFibreChannelHba{ + HostHostBusAdapter: types.HostHostBusAdapter{ + Key: "key-vim.host.FibreChannelHba-vmhba3", + Device: "vmhba3", + Bus: 95, + Status: "online", + Model: "Emulex LightPulse LPe32000 PCIe Fibre Channel Adapter", + Driver: "lpfc", + Pci: "0000:5f:00.0", + }, + PortWorldWideName: 1152922127287604554, + NodeWorldWideName: 2305843631894451530, + PortType: "unknown", + Speed: 16, + }, + &types.HostSerialAttachedHba{ + HostHostBusAdapter: types.HostHostBusAdapter{ + Key: "key-vim.host.SerialAttachedHba-vmhba4", + Device: "vmhba4", + Bus: 24, + Status: "unknown", + Model: "PERC H330 Adapter", + Driver: "lsi_mr3", + Pci: "0000:18:00.0", + }, + NodeWorldWideName: "5d0946606e78ac00", + }, +} diff --git a/vendor/github.com/vmware/govmomi/simulator/host_system.go b/vendor/github.com/vmware/govmomi/simulator/host_system.go index f5158c5135a..f28101a8c3e 100644 --- a/vendor/github.com/vmware/govmomi/simulator/host_system.go +++ b/vendor/github.com/vmware/govmomi/simulator/host_system.go @@ -17,10 +17,10 @@ limitations under the License. package simulator import ( + "net" "os" "time" - "github.com/google/uuid" "github.com/vmware/govmomi/simulator/esx" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" @@ -36,6 +36,11 @@ type HostSystem struct { mo.HostSystem } +func asHostSystemMO(obj mo.Reference) (*mo.HostSystem, bool) { + h, ok := getManagedObject(obj).Addr().Interface().(*mo.HostSystem) + return h, ok +} + func NewHostSystem(host mo.HostSystem) *HostSystem { if hostPortUnique { // configure unique port for each host port := &esx.HostSystem.Summary.Config.Port @@ -53,15 +58,19 @@ func NewHostSystem(host mo.HostSystem) *HostSystem { hs.Summary.Runtime = &hs.Runtime hs.Summary.Runtime.BootTime = &now - id := uuid.New().String() - + // shallow copy Summary.Hardware, as each host will be assigned its own .Uuid hardware := *host.Summary.Hardware hs.Summary.Hardware = &hardware - hs.Summary.Hardware.Uuid = id - info := *esx.HostHardwareInfo - info.SystemInfo.Uuid = id - hs.Hardware = &info + if hs.Hardware == nil { + // shallow copy Hardware, as each host will be assigned its own .Uuid + info := *esx.HostHardwareInfo + hs.Hardware = &info + } + + cfg := new(types.HostConfigInfo) + deepCopy(hs.Config, cfg) + hs.Config = cfg config := []struct { ref **types.ManagedObjectReference @@ -71,6 +80,7 @@ func NewHostSystem(host mo.HostSystem) *HostSystem { {&hs.ConfigManager.NetworkSystem, NewHostNetworkSystem(&hs.HostSystem)}, {&hs.ConfigManager.AdvancedOption, NewOptionManager(nil, esx.Setting)}, {&hs.ConfigManager.FirewallSystem, NewHostFirewallSystem(&hs.HostSystem)}, + {&hs.ConfigManager.StorageSystem, NewHostStorageSystem(&hs.HostSystem)}, } for _, c := range config { @@ -82,6 +92,22 @@ func NewHostSystem(host mo.HostSystem) *HostSystem { return hs } +func (h *HostSystem) configure(spec types.HostConnectSpec, connected bool) { + h.Runtime.ConnectionState = types.HostSystemConnectionStateDisconnected + if connected { + h.Runtime.ConnectionState = types.HostSystemConnectionStateConnected + } + if net.ParseIP(spec.HostName) != nil { + h.Config.Network.Vnic[0].Spec.Ip.IpAddress = spec.HostName + } + + h.Summary.Config.Name = spec.HostName + h.Name = h.Summary.Config.Name + id := newUUID(h.Name) + h.Summary.Hardware.Uuid = id + h.Hardware.SystemInfo.Uuid = id +} + func (h *HostSystem) event() types.HostEvent { return types.HostEvent{ Event: types.Event{ @@ -133,42 +159,55 @@ func addComputeResource(s *types.ComputeResourceSummary, h *HostSystem) { // CreateDefaultESX creates a standalone ESX // Adds objects of type: Datacenter, Network, ComputeResource, ResourcePool and HostSystem -func CreateDefaultESX(f *Folder) { - dc := NewDatacenter(f) +func CreateDefaultESX(ctx *Context, f *Folder) { + dc := NewDatacenter(ctx, &f.Folder) host := NewHostSystem(esx.HostSystem) summary := new(types.ComputeResourceSummary) addComputeResource(summary, host) - cr := &mo.ComputeResource{Summary: summary} + cr := &mo.ComputeResource{ + Summary: summary, + Network: esx.Datacenter.Network, + } cr.EnvironmentBrowser = newEnvironmentBrowser() cr.Self = *host.Parent cr.Name = host.Name cr.Host = append(cr.Host, host.Reference()) - Map.PutEntity(cr, host) + host.Network = cr.Network + ctx.Map.PutEntity(cr, host) pool := NewResourcePool() cr.ResourcePool = &pool.Self - Map.PutEntity(cr, pool) + ctx.Map.PutEntity(cr, pool) pool.Owner = cr.Self - Map.Get(dc.HostFolder).(*Folder).putChild(cr) + folderPutChild(ctx, &ctx.Map.Get(dc.HostFolder).(*Folder).Folder, cr) } // CreateStandaloneHost uses esx.HostSystem as a template, applying the given spec // and creating the ComputeResource parent and ResourcePool sibling. -func CreateStandaloneHost(f *Folder, spec types.HostConnectSpec) (*HostSystem, types.BaseMethodFault) { +func CreateStandaloneHost(ctx *Context, f *Folder, spec types.HostConnectSpec) (*HostSystem, types.BaseMethodFault) { if spec.HostName == "" { return nil, &types.NoHost{} } - pool := NewResourcePool() - host := NewHostSystem(esx.HostSystem) + template := esx.HostSystem + network := ctx.Map.getEntityDatacenter(f).defaultNetwork() - host.Summary.Config.Name = spec.HostName - host.Name = host.Summary.Config.Name - host.Runtime.ConnectionState = types.HostSystemConnectionStateDisconnected + if p := ctx.Map.FindByName(spec.UserName, f.ChildEntity); p != nil { + cr := p.(*mo.ComputeResource) + h := ctx.Map.Get(cr.Host[0]) + // "clone" an existing host from the inventory + template = h.(*HostSystem).HostSystem + template.Vm = nil + network = cr.Network + } + + pool := NewResourcePool() + host := NewHostSystem(template) + host.configure(spec, false) summary := new(types.ComputeResourceSummary) addComputeResource(summary, host) @@ -181,17 +220,19 @@ func CreateStandaloneHost(f *Folder, spec types.HostConnectSpec) (*HostSystem, t EnvironmentBrowser: newEnvironmentBrowser(), } - Map.PutEntity(cr, Map.NewEntity(host)) + ctx.Map.PutEntity(cr, ctx.Map.NewEntity(host)) host.Summary.Host = &host.Self - Map.PutEntity(cr, Map.NewEntity(pool)) + ctx.Map.PutEntity(cr, ctx.Map.NewEntity(pool)) cr.Name = host.Name + cr.Network = network cr.Host = append(cr.Host, host.Reference()) cr.ResourcePool = &pool.Self - f.putChild(cr) + folderPutChild(ctx, &f.Folder, cr) pool.Owner = cr.Self + host.Network = cr.Network return host, nil } @@ -204,20 +245,20 @@ func (h *HostSystem) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.Has ctx.postEvent(&types.HostRemovedEvent{HostEvent: h.event()}) - f := Map.getEntityParent(h, "Folder").(*Folder) - f.removeChild(h.Reference()) + f := ctx.Map.getEntityParent(h, "Folder").(*Folder) + folderRemoveChild(ctx, &f.Folder, h.Reference()) return nil, nil }) return &methods.Destroy_TaskBody{ Res: &types.Destroy_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (h *HostSystem) EnterMaintenanceModeTask(spec *types.EnterMaintenanceMode_Task) soap.HasFault { +func (h *HostSystem) EnterMaintenanceModeTask(ctx *Context, spec *types.EnterMaintenanceMode_Task) soap.HasFault { task := CreateTask(h, "enterMaintenanceMode", func(t *Task) (types.AnyType, types.BaseMethodFault) { h.Runtime.InMaintenanceMode = true return nil, nil @@ -225,12 +266,12 @@ func (h *HostSystem) EnterMaintenanceModeTask(spec *types.EnterMaintenanceMode_T return &methods.EnterMaintenanceMode_TaskBody{ Res: &types.EnterMaintenanceMode_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (h *HostSystem) ExitMaintenanceModeTask(spec *types.ExitMaintenanceMode_Task) soap.HasFault { +func (h *HostSystem) ExitMaintenanceModeTask(ctx *Context, spec *types.ExitMaintenanceMode_Task) soap.HasFault { task := CreateTask(h, "exitMaintenanceMode", func(t *Task) (types.AnyType, types.BaseMethodFault) { h.Runtime.InMaintenanceMode = false return nil, nil @@ -238,7 +279,33 @@ func (h *HostSystem) ExitMaintenanceModeTask(spec *types.ExitMaintenanceMode_Tas return &methods.ExitMaintenanceMode_TaskBody{ Res: &types.ExitMaintenanceMode_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), + }, + } +} + +func (h *HostSystem) DisconnectHostTask(ctx *Context, spec *types.DisconnectHost_Task) soap.HasFault { + task := CreateTask(h, "disconnectHost", func(t *Task) (types.AnyType, types.BaseMethodFault) { + h.Runtime.ConnectionState = types.HostSystemConnectionStateDisconnected + return nil, nil + }) + + return &methods.DisconnectHost_TaskBody{ + Res: &types.DisconnectHost_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (h *HostSystem) ReconnectHostTask(ctx *Context, spec *types.ReconnectHost_Task) soap.HasFault { + task := CreateTask(h, "reconnectHost", func(t *Task) (types.AnyType, types.BaseMethodFault) { + h.Runtime.ConnectionState = types.HostSystemConnectionStateConnected + return nil, nil + }) + + return &methods.ReconnectHost_TaskBody{ + Res: &types.ReconnectHost_TaskResponse{ + Returnval: task.Run(ctx), }, } } diff --git a/vendor/github.com/vmware/govmomi/simulator/http_nfc_lease.go b/vendor/github.com/vmware/govmomi/simulator/http_nfc_lease.go new file mode 100644 index 00000000000..26e0d299fc1 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/simulator/http_nfc_lease.go @@ -0,0 +1,137 @@ +/* +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 simulator + +import ( + "fmt" + "io" + "io/ioutil" + "log" + "net/http" + "os" + "strings" + "sync" + + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type HttpNfcLease struct { + mo.HttpNfcLease + files map[string]string +} + +var ( + nfcLease sync.Map // HTTP access to NFC leases are token based and do not require Session auth + nfcPrefix = "/nfc/" +) + +// ServeNFC handles NFC file upload/download +func ServeNFC(w http.ResponseWriter, r *http.Request) { + p := strings.Split(r.URL.Path, "/") + id, name := p[len(p)-2], p[len(p)-1] + ref := types.ManagedObjectReference{Type: "HttpNfcLease", Value: id} + l, ok := nfcLease.Load(ref) + if !ok { + log.Printf("invalid NFC lease: %s", id) + http.NotFound(w, r) + return + } + lease := l.(*HttpNfcLease) + file, ok := lease.files[name] + if !ok { + log.Printf("invalid NFC device id: %s", name) + http.NotFound(w, r) + return + } + + status := http.StatusOK + var dst io.Writer + var src io.ReadCloser + + switch r.Method { + case http.MethodPut, http.MethodPost: + dst = ioutil.Discard + src = r.Body + case http.MethodGet: + f, err := os.Open(file) + if err != nil { + http.NotFound(w, r) + return + } + src = f + default: + status = http.StatusMethodNotAllowed + } + + n, err := io.Copy(dst, src) + _ = src.Close() + + msg := fmt.Sprintf("transferred %d bytes", n) + if err != nil { + status = http.StatusInternalServerError + msg = err.Error() + } + tracef("nfc %s %s: %s", r.Method, file, msg) + w.WriteHeader(status) +} + +func NewHttpNfcLease(ctx *Context, entity types.ManagedObjectReference) *HttpNfcLease { + lease := &HttpNfcLease{ + HttpNfcLease: mo.HttpNfcLease{ + Info: &types.HttpNfcLeaseInfo{ + Entity: entity, + LeaseTimeout: 30000, + }, + State: types.HttpNfcLeaseStateReady, + }, + files: make(map[string]string), + } + + ctx.Session.Put(lease) + nfcLease.Store(lease.Reference(), lease) + + return lease +} + +func (l *HttpNfcLease) HttpNfcLeaseComplete(ctx *Context, req *types.HttpNfcLeaseComplete) soap.HasFault { + ctx.Session.Remove(ctx, req.This) + nfcLease.Delete(req.This) + + return &methods.HttpNfcLeaseCompleteBody{ + Res: new(types.HttpNfcLeaseCompleteResponse), + } +} + +func (l *HttpNfcLease) HttpNfcLeaseAbort(ctx *Context, req *types.HttpNfcLeaseAbort) soap.HasFault { + ctx.Session.Remove(ctx, req.This) + nfcLease.Delete(req.This) + + return &methods.HttpNfcLeaseAbortBody{ + Res: new(types.HttpNfcLeaseAbortResponse), + } +} + +func (l *HttpNfcLease) HttpNfcLeaseProgress(ctx *Context, req *types.HttpNfcLeaseProgress) soap.HasFault { + l.TransferProgress = req.Percent + + return &methods.HttpNfcLeaseProgressBody{ + Res: new(types.HttpNfcLeaseProgressResponse), + } +} diff --git a/vendor/github.com/vmware/govmomi/simulator/internal/object_lock.go b/vendor/github.com/vmware/govmomi/simulator/internal/object_lock.go new file mode 100644 index 00000000000..fdc6c9bd9b1 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/simulator/internal/object_lock.go @@ -0,0 +1,102 @@ +/* +Copyright (c) 2014-2022 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES 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 ( + "fmt" + "sync" +) + +// SharedLockingContext is used to identify when locks can be shared. In +// practice, simulator code uses the simulator.Context for a request, but in +// principle this could be anything. +type SharedLockingContext interface{} + +// ObjectLock implements a basic "reference-counted" mutex, where a single +// SharedLockingContext can "share" the lock across code paths or child tasks. +type ObjectLock struct { + lock sync.Locker + + stateLock sync.Mutex + heldBy SharedLockingContext + count int64 +} + +// NewObjectLock creates a new ObjectLock. Pass new(sync.Mutex) if you don't +// have a custom sync.Locker. +func NewObjectLock(lock sync.Locker) *ObjectLock { + return &ObjectLock{ + lock: lock, + } +} + +// try returns true if the lock has been acquired; false otherwise +func (l *ObjectLock) try(onBehalfOf SharedLockingContext) bool { + l.stateLock.Lock() + defer l.stateLock.Unlock() + + if l.heldBy == onBehalfOf { + l.count = l.count + 1 + return true + } + + if l.heldBy == nil { + // we expect no contention for this lock (unless the object has a custom Locker) + l.lock.Lock() + l.count = 1 + l.heldBy = onBehalfOf + return true + } + + return false +} + +// wait returns when there's a chance that try() might succeed. +// It is intended to be better than busy-waiting or sleeping. +func (l *ObjectLock) wait() { + l.lock.Lock() + l.lock.Unlock() +} + +// Release decrements the reference count. The caller should pass their +// context, which is used to sanity check that the Unlock() call is valid. If +// this is the last reference to the lock for this SharedLockingContext, the lock +// is Unlocked and can be acquired by another SharedLockingContext. +func (l *ObjectLock) Release(onBehalfOf SharedLockingContext) { + l.stateLock.Lock() + defer l.stateLock.Unlock() + if l.heldBy != onBehalfOf { + panic(fmt.Sprintf("Attempt to unlock on behalf of %#v, but is held by %#v", onBehalfOf, l.heldBy)) + } + l.count = l.count - 1 + if l.count == 0 { + l.heldBy = nil + l.lock.Unlock() + } +} + +// Acquire blocks until it can acquire the lock for onBehalfOf +func (l *ObjectLock) Acquire(onBehalfOf SharedLockingContext) { + acquired := false + for !acquired { + if l.try(onBehalfOf) { + return + } else { + l.wait() + } + } +} diff --git a/vendor/github.com/vmware/govmomi/simulator/internal/server.go b/vendor/github.com/vmware/govmomi/simulator/internal/server.go new file mode 100644 index 00000000000..1f814dea29d --- /dev/null +++ b/vendor/github.com/vmware/govmomi/simulator/internal/server.go @@ -0,0 +1,353 @@ +/* +Copyright (c) 2014-2022 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES 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 ( + "crypto/tls" + "crypto/x509" + "fmt" + "log" + "net" + "net/http" + "strings" + "sync" + "time" +) + +// A Server is an HTTP server listening on a system-chosen port on the +// local loopback interface, for use in end-to-end HTTP tests. +type Server struct { + URL string // base URL of form http://ipaddr:port with no trailing slash + Listener net.Listener + + // TLS is the optional TLS configuration, populated with a new config + // after TLS is started. If set on an unstarted server before StartTLS + // is called, existing fields are copied into the new config. + TLS *tls.Config + + // Config may be changed after calling NewUnstartedServer and + // before Start or StartTLS. + Config *http.Server + + // certificate is a parsed version of the TLS config certificate, if present. + certificate *x509.Certificate + + // wg counts the number of outstanding HTTP requests on this server. + // Close blocks until all requests are finished. + wg sync.WaitGroup + + mu sync.Mutex // guards closed and conns + closed bool + conns map[net.Conn]http.ConnState // except terminal states + + // client is configured for use with the server. + // Its transport is automatically closed when Close is called. + client *http.Client +} + +func newLocalListener(serve string) net.Listener { + if serve != "" { + l, err := net.Listen("tcp", serve) + if err != nil { + panic(fmt.Sprintf("httptest: failed to listen on %v: %v", serve, err)) + } + return l + } + l, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + if l, err = net.Listen("tcp6", "[::1]:0"); err != nil { + panic(fmt.Sprintf("httptest: failed to listen on a port: %v", err)) + } + } + return l +} + +// NewServer starts and returns a new Server. +// The caller should call Close when finished, to shut it down. +func NewServer(handler http.Handler) *Server { + ts := NewUnstartedServer(handler, "") + ts.Start() + return ts +} + +// NewUnstartedServer returns a new Server but doesn't start it. +// +// After changing its configuration, the caller should call Start or +// StartTLS. +// +// The caller should call Close when finished, to shut it down. +// serve allows the server's listen address to be specified. +func NewUnstartedServer(handler http.Handler, serve string) *Server { + return &Server{ + Listener: newLocalListener(serve), + Config: &http.Server{Handler: handler}, + } +} + +// Start starts a server from NewUnstartedServer. +func (s *Server) Start() { + if s.URL != "" { + panic("Server already started") + } + if s.client == nil { + s.client = &http.Client{Transport: &http.Transport{}} + } + s.URL = "http://" + s.Listener.Addr().String() + s.wrap() + s.goServe() +} + +// StartTLS starts TLS on a server from NewUnstartedServer. +func (s *Server) StartTLS() { + if s.URL != "" { + panic("Server already started") + } + if s.client == nil { + s.client = &http.Client{Transport: &http.Transport{}} + } + cert, err := tls.X509KeyPair(LocalhostCert, LocalhostKey) + if err != nil { + panic(fmt.Sprintf("httptest: NewTLSServer: %v", err)) + } + + existingConfig := s.TLS + if existingConfig != nil { + s.TLS = existingConfig.Clone() + } else { + s.TLS = new(tls.Config) + } + if s.TLS.NextProtos == nil { + s.TLS.NextProtos = []string{"http/1.1"} + } + if len(s.TLS.Certificates) == 0 { + s.TLS.Certificates = []tls.Certificate{cert} + } + s.certificate, err = x509.ParseCertificate(s.TLS.Certificates[0].Certificate[0]) + if err != nil { + panic(fmt.Sprintf("httptest: NewTLSServer: %v", err)) + } + certpool := x509.NewCertPool() + certpool.AddCert(s.certificate) + s.client.Transport = &http.Transport{ + TLSClientConfig: &tls.Config{ + RootCAs: certpool, + }, + } + s.Listener = tls.NewListener(s.Listener, s.TLS) + s.URL = "https://" + s.Listener.Addr().String() + s.wrap() + s.goServe() +} + +// NewTLSServer starts and returns a new Server using TLS. +// The caller should call Close when finished, to shut it down. +func NewTLSServer(handler http.Handler) *Server { + ts := NewUnstartedServer(handler, "") + ts.StartTLS() + return ts +} + +type closeIdleTransport interface { + CloseIdleConnections() +} + +// Close shuts down the server and blocks until all outstanding +// requests on this server have completed. +func (s *Server) Close() { + s.mu.Lock() + if !s.closed { + s.closed = true + s.Listener.Close() + s.Config.SetKeepAlivesEnabled(false) + for c, st := range s.conns { + // Force-close any idle connections (those between + // requests) and new connections (those which connected + // but never sent a request). StateNew connections are + // super rare and have only been seen (in + // previously-flaky tests) in the case of + // socket-late-binding races from the http Client + // dialing this server and then getting an idle + // connection before the dial completed. There is thus + // a connected connection in StateNew with no + // associated Request. We only close StateIdle and + // StateNew because they're not doing anything. It's + // possible StateNew is about to do something in a few + // milliseconds, but a previous CL to check again in a + // few milliseconds wasn't liked (early versions of + // https://golang.org/cl/15151) so now we just + // forcefully close StateNew. The docs for Server.Close say + // we wait for "outstanding requests", so we don't close things + // in StateActive. + if st == http.StateIdle || st == http.StateNew { + s.closeConn(c) + } + } + // If this server doesn't shut down in 5 seconds, tell the user why. + t := time.AfterFunc(5*time.Second, s.logCloseHangDebugInfo) + defer t.Stop() + } + s.mu.Unlock() + + // Not part of httptest.Server's correctness, but assume most + // users of httptest.Server will be using the standard + // transport, so help them out and close any idle connections for them. + if t, ok := http.DefaultTransport.(closeIdleTransport); ok { + t.CloseIdleConnections() + } + + // Also close the client idle connections. + if s.client != nil { + if t, ok := s.client.Transport.(closeIdleTransport); ok { + t.CloseIdleConnections() + } + } + + s.wg.Wait() +} + +func (s *Server) logCloseHangDebugInfo() { + s.mu.Lock() + defer s.mu.Unlock() + var buf strings.Builder + buf.WriteString("httptest.Server blocked in Close after 5 seconds, waiting for connections:\n") + for c, st := range s.conns { + fmt.Fprintf(&buf, " %T %p %v in state %v\n", c, c, c.RemoteAddr(), st) + } + log.Print(buf.String()) +} + +// CloseClientConnections closes any open HTTP connections to the test Server. +func (s *Server) CloseClientConnections() { + s.mu.Lock() + nconn := len(s.conns) + ch := make(chan struct{}, nconn) + for c := range s.conns { + go s.closeConnChan(c, ch) + } + s.mu.Unlock() + + // Wait for outstanding closes to finish. + // + // Out of paranoia for making a late change in Go 1.6, we + // bound how long this can wait, since golang.org/issue/14291 + // isn't fully understood yet. At least this should only be used + // in tests. + timer := time.NewTimer(5 * time.Second) + defer timer.Stop() + for i := 0; i < nconn; i++ { + select { + case <-ch: + case <-timer.C: + // Too slow. Give up. + return + } + } +} + +// Certificate returns the certificate used by the server, or nil if +// the server doesn't use TLS. +func (s *Server) Certificate() *x509.Certificate { + return s.certificate +} + +// Client returns an HTTP client configured for making requests to the server. +// It is configured to trust the server's TLS test certificate and will +// close its idle connections on Server.Close. +func (s *Server) Client() *http.Client { + return s.client +} + +func (s *Server) goServe() { + s.wg.Add(1) + go func() { + defer s.wg.Done() + s.Config.Serve(s.Listener) + }() +} + +// wrap installs the connection state-tracking hook to know which +// connections are idle. +func (s *Server) wrap() { + oldHook := s.Config.ConnState + s.Config.ConnState = func(c net.Conn, cs http.ConnState) { + s.mu.Lock() + defer s.mu.Unlock() + switch cs { + case http.StateNew: + s.wg.Add(1) + if _, exists := s.conns[c]; exists { + panic("invalid state transition") + } + if s.conns == nil { + s.conns = make(map[net.Conn]http.ConnState) + } + s.conns[c] = cs + if s.closed { + // Probably just a socket-late-binding dial from + // the default transport that lost the race (and + // thus this connection is now idle and will + // never be used). + s.closeConn(c) + } + case http.StateActive: + if oldState, ok := s.conns[c]; ok { + if oldState != http.StateNew && oldState != http.StateIdle { + panic("invalid state transition") + } + s.conns[c] = cs + } + case http.StateIdle: + if oldState, ok := s.conns[c]; ok { + if oldState != http.StateActive { + panic("invalid state transition") + } + s.conns[c] = cs + } + if s.closed { + s.closeConn(c) + } + case http.StateHijacked, http.StateClosed: + s.forgetConn(c) + } + if oldHook != nil { + oldHook(c, cs) + } + } +} + +// closeConn closes c. +// s.mu must be held. +func (s *Server) closeConn(c net.Conn) { s.closeConnChan(c, nil) } + +// closeConnChan is like closeConn, but takes an optional channel to receive a value +// when the goroutine closing c is done. +func (s *Server) closeConnChan(c net.Conn, done chan<- struct{}) { + c.Close() + if done != nil { + done <- struct{}{} + } +} + +// forgetConn removes c from the set of tracked conns and decrements it from the +// waitgroup, unless it was previously removed. +// s.mu must be held. +func (s *Server) forgetConn(c net.Conn) { + if _, ok := s.conns[c]; ok { + delete(s.conns, c) + s.wg.Done() + } +} diff --git a/vendor/github.com/vmware/govmomi/simulator/internal/testcert.go b/vendor/github.com/vmware/govmomi/simulator/internal/testcert.go new file mode 100644 index 00000000000..3c8640e2cf5 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/simulator/internal/testcert.go @@ -0,0 +1,76 @@ +/* +Copyright (c) 2014-2022 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES 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 + +// LocalhostCert is a PEM-encoded TLS cert with SAN IPs +// "127.0.0.1" and "[::1]", expiring at Jan 29 16:00:00 2084 GMT. +// generated from src/crypto/tls: +// go run generate_cert.go --rsa-bits 2048 --host 127.0.0.1,::1,example.com --ca --start-date "Jan 1 00:00:00 1970" --duration=1000000h +// +// Please note the certificate was updated to 2048 bits due to macOS now +// requiring RSA keys of at least 2048 bits. For more information, please see: +// https://developer.apple.com/documentation/security/preventing_insecure_network_connections +var LocalhostCert = []byte(`-----BEGIN CERTIFICATE----- +MIIDOjCCAiKgAwIBAgIRAK6d/JpGL75P2wOSYc6WalEwDQYJKoZIhvcNAQELBQAw +EjEQMA4GA1UEChMHQWNtZSBDbzAgFw03MDAxMDEwMDAwMDBaGA8yMDg0MDEyOTE2 +MDAwMFowEjEQMA4GA1UEChMHQWNtZSBDbzCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAK9lInM4OAKI4z+wDNkvcZC6S6exFSOysp7NPJyaEAhW93kPY7gO +f6H5aP3V3YU0vYpCSnz/UhyDD+/knBof1J3Do7FVwYtC293vrtXffNtAvygfJodW +1dPllp17ZJbq76ei9oWq1Y5Hox/sVYmNVNztvBfK1mtpS8z8Qrk1LWCyLiDHkvDA +hCy2OjuaopxC6qQejdWT1PxwbqptuLVakQmecpiFrupy8DTG0x0rxxdMdAATywhY +Gm49A/FroagZ6HMz3bm39we/w6VIx3pX1lbUUyrfjvBgfUlRwxyZABBj2STGsOQJ +a451eEcESXcSEWzjGjUQ1Wf+zzxr2GAHmI8CAwEAAaOBiDCBhTAOBgNVHQ8BAf8E +BAMCAqQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDwYDVR0TAQH/BAUwAwEB/zAdBgNV +HQ4EFgQUjtR2VSuxchTxe0UNDVqWDNMR37AwLgYDVR0RBCcwJYILZXhhbXBsZS5j +b22HBH8AAAGHEAAAAAAAAAAAAAAAAAAAAAEwDQYJKoZIhvcNAQELBQADggEBACK7 +1L15IeYPiQHFDml3EgDoRnd/tAaZP9nUZIIPLRgUnQITNAtjFgBvqneQZwlQtco2 +s8YXSivBQiATlBEtGBzVxv36R4tTXldIgJxaCUxxZtqALLwyGqSaI/cwE0pWa6Z0 +Op2wkzUmoQ5rRrJfRM+C6HR/+lWkNtHRzaUFOSlxNJbPo53K53OoDriwEc1PvEYP +wFeUXwTzCZ68pAlWUmDKCyp+lPhjIt2Gznig+BSPCNJqmwKM76oFyywi3HIP56rD +/cwUtoplF68uVuD8HXb1ggGsqtGiAT4GLT8tU5w+BtK8ZIs/LK7mdi7W8aIOhUUH +l1lgeV3oEQue3A7SogA= +-----END CERTIFICATE-----`) + +// LocalhostKey is the private key for localhostCert. +var LocalhostKey = []byte(`-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCvZSJzODgCiOM/ +sAzZL3GQukunsRUjsrKezTycmhAIVvd5D2O4Dn+h+Wj91d2FNL2KQkp8/1Icgw/v +5JwaH9Sdw6OxVcGLQtvd767V33zbQL8oHyaHVtXT5Zade2SW6u+novaFqtWOR6Mf +7FWJjVTc7bwXytZraUvM/EK5NS1gsi4gx5LwwIQstjo7mqKcQuqkHo3Vk9T8cG6q +bbi1WpEJnnKYha7qcvA0xtMdK8cXTHQAE8sIWBpuPQPxa6GoGehzM925t/cHv8Ol +SMd6V9ZW1FMq347wYH1JUcMcmQAQY9kkxrDkCWuOdXhHBEl3EhFs4xo1ENVn/s88 +a9hgB5iPAgMBAAECggEAEpeS3knQThx6kk60HfWUgTXuPRldV0pi+shgq2z9VBT7 +6J5EAMewqdfJVFbuQ2eCy/wY70UVTCZscw51qaNEI3EQkgS4Hm345n64tr0Y/BjR +6ovaxq/ivLJyk8D3ubOvscJphWPFfW6EkSa5LnqHy197972tmvcvbMw0unMzmzM7 +DenXdoIJQu1SqLiLUiDXEfkvCReekqhe1jATCwTzIBTCnTWxgI4Ox2qsBaxuwrnl +D1GpWy4sh8NpDB0EBwdrjAOmLDOyvsy2X65DIlHS/k7901tvzyNjRrsr2Ig0sAz4 +w0ke6CUKQ2B+Pqn3p6bvxRYMP08+ZjlQpPuU4RrxGQKBgQDd3HCrZCgUJAGcfzYX +ZzSmSoxB9+sEuVUZGU+ICMPlG0Dd8aEkXIyDjGMWsLFMIvzNBf4wB1FwdLaCJu6y +0PbX3KVfg/Yc4lvYUuQ+1nD/3gm2hE46lZuSfbmExH5SQVLSbSQf9S/5BTHAWQO9 +PNie71AZ8fO5YDBM18tq2V7dBQKBgQDKYk1+Zup5p0BeRyCNnVYnpngO+pAZZmld +gYiRn8095QJ/Y+yV0kYc2+0+5f6St462E+PVH3tX1l9OG3ujVQnWfu2iSsRJRMUf +0blxqTWvqdcGi8SLpVjkrHn30scFNWmojhJv3k42H3nUMC1+WU3rp2f7+W58afyd +NY9x4sqzgwKBgQCoeMq9+3JLyQPIOPl0UBS06gsT1RUMI0gxpPy1yiInich6QRAi +snypMCPWiRo5PKBHd/OLuSLoiFhHARVliDTJum2B2I09Zc5kuJ1F8kUgpxUtGc7l +wdG/LeWAok1iXORtkh9KfT+Ok5kx/OZP/zJnjkZ/TTHMZPSIhZ2cZ7AXmQKBgHMP +HjWNtyKApsSytVwtpgyWxMznQMNgCOkjOoxoCJx2tUvNeHTY/glsM14+DdRFzTnQ +5weEhXAzrS1PzKPYNeafdOR+k0eAdH2Zk09+PspmyZusHIqz72zabeEqEQHyEubE +FtFI1rhIfs/WsBaUGQuvuhtz/I95BiguiiXaJRmXAoGADwcO6YXoWXga07gGRwZP +LYKwt5wBh13LAGbSsUyCSK5FG6ZrTmzaFdAGV1U4wc/wgiIgv33m8BG4Ikxvpa0r +Wg3dbhBx9Oya8QWIMBPk72KKEzsSDfi+Cn52ZmxTkWbBDCnkRhG77Ooi8vJ3dhq4 +fHeAu1F9OwF83SBi1oNySd8= +-----END PRIVATE KEY-----`) diff --git a/vendor/github.com/vmware/govmomi/simulator/internal/types.go b/vendor/github.com/vmware/govmomi/simulator/internal/types.go new file mode 100644 index 00000000000..8ba22088116 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/simulator/internal/types.go @@ -0,0 +1,73 @@ +/* +Copyright (c) 2014-2022 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES 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 ( + "reflect" + + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +// Minimal set of internal types and methods: +// - Fetch() - used by ovftool to collect various managed object properties +// - RetrieveInternalContent() - used by ovftool to obtain a reference to NfcService (which it does not use by default) + +func init() { + types.Add("Fetch", reflect.TypeOf((*Fetch)(nil)).Elem()) +} + +type Fetch struct { + This types.ManagedObjectReference `xml:"_this"` + Prop string `xml:"prop"` +} + +type FetchResponse struct { + Returnval types.AnyType `xml:"returnval,omitempty,typeattr"` +} + +type FetchBody struct { + Res *FetchResponse `xml:"FetchResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FetchBody) Fault() *soap.Fault { return b.Fault_ } + +func init() { + types.Add("RetrieveInternalContent", reflect.TypeOf((*RetrieveInternalContent)(nil)).Elem()) +} + +type RetrieveInternalContent struct { + This types.ManagedObjectReference `xml:"_this"` +} + +type RetrieveInternalContentResponse struct { + Returnval InternalServiceInstanceContent `xml:"returnval"` +} + +type RetrieveInternalContentBody struct { + Res *RetrieveInternalContentResponse `xml:"RetrieveInternalContentResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveInternalContentBody) Fault() *soap.Fault { return b.Fault_ } + +type InternalServiceInstanceContent struct { + types.DynamicData + + NfcService types.ManagedObjectReference `xml:"nfcService"` +} diff --git a/vendor/github.com/vmware/govmomi/simulator/ip_pool_manager.go b/vendor/github.com/vmware/govmomi/simulator/ip_pool_manager.go index 8c98de5ba27..d8ef992a369 100644 --- a/vendor/github.com/vmware/govmomi/simulator/ip_pool_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/ip_pool_manager.go @@ -59,16 +59,11 @@ type IpPoolManager struct { nextPoolId int32 } -func NewIpPoolManager(ref types.ManagedObjectReference) *IpPoolManager { - m := &IpPoolManager{} - m.Self = ref - +func (m *IpPoolManager) init(*Registry) { m.pools = map[int32]*IpPool{ 1: ipPool, } m.nextPoolId = 2 - - return m } func (m *IpPoolManager) CreateIpPool(req *types.CreateIpPool) soap.HasFault { diff --git a/vendor/github.com/vmware/govmomi/simulator/license_manager.go b/vendor/github.com/vmware/govmomi/simulator/license_manager.go index 13612185f2e..6097359663d 100644 --- a/vendor/github.com/vmware/govmomi/simulator/license_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/license_manager.go @@ -30,7 +30,6 @@ limitations under the License. package simulator import ( - "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/soap" @@ -64,17 +63,13 @@ type LicenseManager struct { mo.LicenseManager } -func NewLicenseManager(ref types.ManagedObjectReference) object.Reference { - m := &LicenseManager{} - m.Self = ref +func (m *LicenseManager) init(r *Registry) { m.Licenses = []types.LicenseManagerLicenseInfo{EvalLicense} - if Map.IsVPX() { + if r.IsVPX() { am := Map.Put(&LicenseAssignmentManager{}).Reference() m.LicenseAssignmentManager = &am } - - return m } func (m *LicenseManager) AddLicense(req *types.AddLicense) soap.HasFault { diff --git a/vendor/github.com/vmware/govmomi/simulator/model.go b/vendor/github.com/vmware/govmomi/simulator/model.go index 2e6e260f5d4..7d137dd2be4 100644 --- a/vendor/github.com/vmware/govmomi/simulator/model.go +++ b/vendor/github.com/vmware/govmomi/simulator/model.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. +Copyright (c) 2017-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. @@ -18,16 +18,30 @@ package simulator import ( "context" + "crypto/tls" "fmt" "io/ioutil" + "log" + "math/rand" "os" "path" + "path/filepath" + "reflect" + "strings" + "time" + "github.com/google/uuid" + + "github.com/vmware/govmomi" "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/simulator/esx" "github.com/vmware/govmomi/simulator/vpx" + "github.com/vmware/govmomi/units" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vim25/xml" ) type DelayConfig struct { @@ -48,6 +62,8 @@ type DelayConfig struct { // Model is used to populate a Model with an initial set of managed entities. // This is a simple helper for tests running against a simulator, to populate an inventory // with commonly used models. +// The inventory names generated by a Model have a string prefix per-type and integer suffix per-instance. +// The names are concatenated with their ancestor names and delimited by '_', making the generated names unique. type Model struct { Service *Service `json:"-"` @@ -58,44 +74,75 @@ type Model struct { Autostart bool `json:"-"` // Datacenter specifies the number of Datacenter entities to create + // Name prefix: DC, vcsim flag: -dc Datacenter int // Portgroup specifies the number of DistributedVirtualPortgroup entities to create per Datacenter + // Name prefix: DVPG, vcsim flag: -pg Portgroup int + // PortgroupNSX specifies the number NSX backed DistributedVirtualPortgroup entities to create per Datacenter + // Name prefix: NSXPG, vcsim flag: -nsx-pg + PortgroupNSX int + + // OpaqueNetwork specifies the number of OpaqueNetwork entities to create per Datacenter, + // with Summary.OpaqueNetworkType set to nsx.LogicalSwitch and Summary.OpaqueNetworkId to a random uuid. + // Name prefix: NSX, vcsim flag: -nsx + OpaqueNetwork int + // Host specifies the number of standalone HostSystems entities to create per Datacenter + // Name prefix: H, vcsim flag: -standalone-host Host int `json:",omitempty"` // Cluster specifies the number of ClusterComputeResource entities to create per Datacenter + // Name prefix: C, vcsim flag: -cluster Cluster int // ClusterHost specifies the number of HostSystems entities to create within a Cluster + // Name prefix: H, vcsim flag: -host ClusterHost int `json:",omitempty"` // Pool specifies the number of ResourcePool entities to create per Cluster + // Note that every cluster has a root ResourcePool named "Resources", as real vCenter does. + // For example: /DC0/host/DC0_C0/Resources + // The root ResourcePool is named "RP0" within other object names. + // When Model.Pool is set to 1 or higher, this creates child ResourcePools under the root pool. + // Note that this flag is not effective on standalone hosts. + // For example: /DC0/host/DC0_C0/Resources/DC0_C0_RP1 + // Name prefix: RP, vcsim flag: -pool Pool int // Datastore specifies the number of Datastore entities to create // Each Datastore will have temporary local file storage and will be mounted // on every HostSystem created by the ModelConfig + // Name prefix: LocalDS, vcsim flag: -ds Datastore int - // Machine specifies the number of VirtualMachine entities to create per ResourcePool + // Machine specifies the number of VirtualMachine entities to create per + // ResourcePool. If the pool flag is specified, the specified number of virtual + // machines will be deployed to each child pool and prefixed with the child + // resource pool name. Otherwise they are deployed into the root resource pool, + // prefixed with RP0. On standalone hosts, machines are always deployed into the + // root resource pool without any prefix. + // Name prefix: VM, vcsim flag: -vm Machine int // Folder specifies the number of Datacenter to place within a Folder. // This includes a folder for the Datacenter itself and its host, vm, network and datastore folders. // All resources for the Datacenter are placed within these folders, rather than the top-level folders. + // Name prefix: F, vcsim flag: -folder Folder int // App specifies the number of VirtualApp to create per Cluster + // Name prefix: APP, vcsim flag: -app App int // Pod specifies the number of StoragePod to create per Cluster + // Name prefix: POD, vcsim flag: -pod Pod int // Delay configurations - DelayConfig DelayConfig + DelayConfig DelayConfig `json:"-"` // total number of inventory objects, set by Count() total int @@ -172,6 +219,8 @@ func (m *Model) Count() Model { count.Folder++ case "StoragePod": count.Pod++ + case "OpaqueNetwork": + count.OpaqueNetwork++ } } @@ -182,11 +231,253 @@ func (*Model) fmtName(prefix string, num int) string { return fmt.Sprintf("%s%d", prefix, num) } +// kinds maps managed object types to their vcsim wrapper types +var kinds = map[string]reflect.Type{ + "AuthorizationManager": reflect.TypeOf((*AuthorizationManager)(nil)).Elem(), + "ClusterComputeResource": reflect.TypeOf((*ClusterComputeResource)(nil)).Elem(), + "CustomFieldsManager": reflect.TypeOf((*CustomFieldsManager)(nil)).Elem(), + "CustomizationSpecManager": reflect.TypeOf((*CustomizationSpecManager)(nil)).Elem(), + "Datacenter": reflect.TypeOf((*Datacenter)(nil)).Elem(), + "Datastore": reflect.TypeOf((*Datastore)(nil)).Elem(), + "DistributedVirtualPortgroup": reflect.TypeOf((*DistributedVirtualPortgroup)(nil)).Elem(), + "DistributedVirtualSwitch": reflect.TypeOf((*DistributedVirtualSwitch)(nil)).Elem(), + "DistributedVirtualSwitchManager": reflect.TypeOf((*DistributedVirtualSwitchManager)(nil)).Elem(), + "EnvironmentBrowser": reflect.TypeOf((*EnvironmentBrowser)(nil)).Elem(), + "EventManager": reflect.TypeOf((*EventManager)(nil)).Elem(), + "FileManager": reflect.TypeOf((*FileManager)(nil)).Elem(), + "Folder": reflect.TypeOf((*Folder)(nil)).Elem(), + "GuestOperationsManager": reflect.TypeOf((*GuestOperationsManager)(nil)).Elem(), + "HostDatastoreBrowser": reflect.TypeOf((*HostDatastoreBrowser)(nil)).Elem(), + "HostLocalAccountManager": reflect.TypeOf((*HostLocalAccountManager)(nil)).Elem(), + "HostNetworkSystem": reflect.TypeOf((*HostNetworkSystem)(nil)).Elem(), + "HostSystem": reflect.TypeOf((*HostSystem)(nil)).Elem(), + "IpPoolManager": reflect.TypeOf((*IpPoolManager)(nil)).Elem(), + "LicenseManager": reflect.TypeOf((*LicenseManager)(nil)).Elem(), + "OptionManager": reflect.TypeOf((*OptionManager)(nil)).Elem(), + "OvfManager": reflect.TypeOf((*OvfManager)(nil)).Elem(), + "PerformanceManager": reflect.TypeOf((*PerformanceManager)(nil)).Elem(), + "PropertyCollector": reflect.TypeOf((*PropertyCollector)(nil)).Elem(), + "ResourcePool": reflect.TypeOf((*ResourcePool)(nil)).Elem(), + "SearchIndex": reflect.TypeOf((*SearchIndex)(nil)).Elem(), + "SessionManager": reflect.TypeOf((*SessionManager)(nil)).Elem(), + "StoragePod": reflect.TypeOf((*StoragePod)(nil)).Elem(), + "StorageResourceManager": reflect.TypeOf((*StorageResourceManager)(nil)).Elem(), + "TaskManager": reflect.TypeOf((*TaskManager)(nil)).Elem(), + "TenantTenantManager": reflect.TypeOf((*TenantManager)(nil)).Elem(), + "UserDirectory": reflect.TypeOf((*UserDirectory)(nil)).Elem(), + "VcenterVStorageObjectManager": reflect.TypeOf((*VcenterVStorageObjectManager)(nil)).Elem(), + "ViewManager": reflect.TypeOf((*ViewManager)(nil)).Elem(), + "VirtualApp": reflect.TypeOf((*VirtualApp)(nil)).Elem(), + "VirtualDiskManager": reflect.TypeOf((*VirtualDiskManager)(nil)).Elem(), + "VirtualMachine": reflect.TypeOf((*VirtualMachine)(nil)).Elem(), + "VmwareDistributedVirtualSwitch": reflect.TypeOf((*DistributedVirtualSwitch)(nil)).Elem(), +} + +func loadObject(content types.ObjectContent) (mo.Reference, error) { + var obj mo.Reference + id := content.Obj + + kind, ok := kinds[id.Type] + if ok { + obj = reflect.New(kind).Interface().(mo.Reference) + } + + if obj == nil { + // No vcsim wrapper for this type, e.g. IoFilterManager + x, err := mo.ObjectContentToType(content, true) + if err != nil { + return nil, err + } + obj = x.(mo.Reference) + } else { + if len(content.PropSet) == 0 { + // via NewServiceInstance() + Map.setReference(obj, id) + } else { + // via Model.Load() + dst := getManagedObject(obj).Addr().Interface().(mo.Reference) + err := mo.LoadObjectContent([]types.ObjectContent{content}, dst) + if err != nil { + return nil, err + } + } + + if x, ok := obj.(interface{ init(*Registry) }); ok { + x.init(Map) + } + } + + return obj, nil +} + +// resolveReferences attempts to resolve any object references that were not included via Load() +// example: Load's dir only contains a single OpaqueNetwork, we need to create a Datacenter and +// place the OpaqueNetwork in the Datacenter's network folder. +func (m *Model) resolveReferences(ctx *Context) error { + dc, ok := ctx.Map.Any("Datacenter").(*Datacenter) + if !ok { + // Need to have at least 1 Datacenter + root := ctx.Map.Get(ctx.Map.content().RootFolder).(*Folder) + ref := root.CreateDatacenter(ctx, &types.CreateDatacenter{ + This: root.Self, + Name: "DC0", + }).(*methods.CreateDatacenterBody).Res.Returnval + dc = ctx.Map.Get(ref).(*Datacenter) + } + + for ref, val := range ctx.Map.objects { + me, ok := val.(mo.Entity) + if !ok { + continue + } + e := me.Entity() + if e.Parent == nil || ref.Type == "Folder" { + continue + } + if ctx.Map.Get(*e.Parent) == nil { + // object was loaded without its parent, attempt to foster with another parent + switch e.Parent.Type { + case "Folder": + folder := dc.folder(me) + e.Parent = &folder.Self + log.Printf("%s adopted %s", e.Parent, ref) + folderPutChild(ctx, folder, me) + default: + return fmt.Errorf("unable to foster %s with parent type=%s", ref, e.Parent.Type) + } + } + // TODO: resolve any remaining orphan references via mo.References() + } + + return nil +} + +func (m *Model) decode(path string, data interface{}) error { + f, err := os.Open(path) + if err != nil { + return err + } + + dec := xml.NewDecoder(f) + dec.TypeFunc = types.TypeFunc() + err = dec.Decode(data) + _ = f.Close() + return err +} + +func (m *Model) loadMethod(obj mo.Reference, dir string) error { + dir = filepath.Join(dir, obj.Reference().Encode()) + + info, err := ioutil.ReadDir(dir) + if err != nil { + if os.IsNotExist(err) { + return nil + } + return err + } + + zero := reflect.Value{} + for _, x := range info { + name := strings.TrimSuffix(x.Name(), ".xml") + "Response" + path := filepath.Join(dir, x.Name()) + response := reflect.ValueOf(obj).Elem().FieldByName(name) + if response == zero { + return fmt.Errorf("field %T.%s not found", obj, name) + } + if err = m.decode(path, response.Addr().Interface()); err != nil { + return err + } + } + + return nil +} + +// When simulator code needs to call other simulator code, it typically passes whatever +// context is associated with the request it's servicing. +// Model code isn't servicing a request, but still needs a context, so we spoof +// one for the purposes of calling simulator code. +// Test code also tends to do this. +func SpoofContext() *Context { + return &Context{ + Context: context.Background(), + Session: &Session{ + UserSession: types.UserSession{ + Key: uuid.New().String(), + }, + Registry: NewRegistry(), + }, + Map: Map, + } +} + +// Load Model from the given directory, as created by the 'govc object.save' command. +func (m *Model) Load(dir string) error { + ctx := SpoofContext() + var s *ServiceInstance + + err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if info.IsDir() { + if path == dir { + return nil + } + return filepath.SkipDir + } + if filepath.Ext(path) != ".xml" { + return nil + } + + var content types.ObjectContent + err = m.decode(path, &content) + if err != nil { + return err + } + + if content.Obj == vim25.ServiceInstance { + s = new(ServiceInstance) + s.Self = content.Obj + Map = NewRegistry() + ctx.Map = Map + ctx.Map.Put(s) + return mo.LoadObjectContent([]types.ObjectContent{content}, &s.ServiceInstance) + } + + if s == nil { + s = NewServiceInstance(ctx, m.ServiceContent, m.RootFolder) + ctx.Map = Map + } + + obj, err := loadObject(content) + if err != nil { + return err + } + + if x, ok := obj.(interface{ model(*Model) error }); ok { + if err = x.model(m); err != nil { + return err + } + } + + return m.loadMethod(ctx.Map.Put(obj), dir) + }) + + if err != nil { + return err + } + + m.Service = New(s) + + return m.resolveReferences(ctx) +} + // Create populates the Model with the given ModelConfig func (m *Model) Create() error { - m.Service = New(NewServiceInstance(m.ServiceContent, m.RootFolder)) + ctx := SpoofContext() + m.Service = New(NewServiceInstance(ctx, m.ServiceContent, m.RootFolder)) + ctx.Map = Map - ctx := context.Background() client := m.Service.client root := object.NewRootFolder(client) @@ -228,7 +519,8 @@ func (m *Model) Create() error { }}, } - _, _ = dvs.Reconfigure(ctx, config) + task, _ = dvs.Reconfigure(ctx, config) + _, _ = task.WaitForResult(context.Background(), nil) } return host, nil @@ -263,7 +555,8 @@ func (m *Model) Create() error { cdrom, _ := devices.CreateCdrom(ide.(*types.VirtualIDEController)) disk := devices.CreateDisk(scsi.(types.BaseVirtualController), ds, config.Files.VmPathName+" "+path.Join(name, "disk1.vmdk")) - disk.CapacityInKB = 1024 + disk.CapacityInKB = int64(units.GB*10) / units.KB + disk.StorageIOAllocation = &types.StorageIOAllocationInfo{Limit: types.NewInt64(-1)} devices = append(devices, scsi, cdrom, disk, &nic) @@ -282,7 +575,8 @@ func (m *Model) Create() error { vm := object.NewVirtualMachine(client, info.Result.(types.ManagedObjectReference)) if m.Autostart { - _, _ = vm.PowerOn(ctx) + task, _ = vm.PowerOn(ctx) + _, _ = task.WaitForResult(ctx, nil) } } @@ -340,7 +634,7 @@ func (m *Model) Create() error { nfolder++ } - if m.Portgroup > 0 { + if m.Portgroup > 0 || m.PortgroupNSX > 0 { var spec types.DVSCreateSpec spec.ConfigSpec = &types.VMwareDVSConfigSpec{} spec.ConfigSpec.GetDVSConfigSpec().Name = m.fmtName("DVS", 0) @@ -356,28 +650,60 @@ func (m *Model) Create() error { } dvs = object.NewDistributedVirtualSwitch(client, info.Result.(types.ManagedObjectReference)) + } - for npg := 0; npg < m.Portgroup; npg++ { - name := m.fmtName(dcName+"_DVPG", npg) + for npg := 0; npg < m.Portgroup; npg++ { + name := m.fmtName(dcName+"_DVPG", npg) + spec := types.DVPortgroupConfigSpec{ + Name: name, + Type: string(types.DistributedVirtualPortgroupPortgroupTypeEarlyBinding), + NumPorts: 1, + } - task, err = dvs.AddPortgroup(ctx, []types.DVPortgroupConfigSpec{{Name: name}}) - if err != nil { - return err - } + task, err := dvs.AddPortgroup(ctx, []types.DVPortgroupConfigSpec{spec}) + if err != nil { + return err + } + if err = task.Wait(ctx); err != nil { + return err + } - err = task.Wait(ctx) - if err != nil { - return err - } + // Use the 1st DVPG for the VMs eth0 backing + if npg == 0 { + // AddPortgroup_Task does not return the moid, so we look it up by name + net := ctx.Map.Get(folders.NetworkFolder.Reference()).(*Folder) + pg := ctx.Map.FindByName(name, net.ChildEntity) - // Use the 1st DVPG for the VMs eth0 backing - if npg == 0 { - // AddPortgroup_Task does not return the moid, so we look it up by name - net := Map.Get(folders.NetworkFolder.Reference()).(*Folder) - pg := Map.FindByName(name, net.ChildEntity) + vmnet, _ = object.NewDistributedVirtualPortgroup(client, pg.Reference()).EthernetCardBackingInfo(ctx) + } + } - vmnet, _ = object.NewDistributedVirtualPortgroup(client, pg.Reference()).EthernetCardBackingInfo(ctx) - } + for npg := 0; npg < m.PortgroupNSX; npg++ { + name := m.fmtName(dcName+"_NSXPG", npg) + spec := types.DVPortgroupConfigSpec{ + Name: name, + Type: string(types.DistributedVirtualPortgroupPortgroupTypeEarlyBinding), + BackingType: string(types.DistributedVirtualPortgroupBackingTypeNsx), + } + + task, err := dvs.AddPortgroup(ctx, []types.DVPortgroupConfigSpec{spec}) + if err != nil { + return err + } + if err = task.Wait(ctx); err != nil { + return err + } + } + + // Must use simulator methods directly for OpaqueNetwork + networkFolder := ctx.Map.Get(folders.NetworkFolder.Reference()).(*Folder) + + for i := 0; i < m.OpaqueNetwork; i++ { + var summary types.OpaqueNetworkSummary + summary.Name = m.fmtName(dcName+"_NSX", i) + err := networkFolder.AddOpaqueNetwork(ctx, summary) + if err != nil { + return err } } @@ -413,19 +739,24 @@ func (m *Model) Create() error { } } - pool, err := cluster.ResourcePool(ctx) + rootRP, err := cluster.ResourcePool(ctx) if err != nil { return err } prefix := clusterName + "_RP" - addMachine(prefix+"0", nil, pool, folders) + // put VMs in cluster RP if no child RP(s) configured + if m.Pool == 0 { + addMachine(prefix+"0", nil, rootRP, folders) + } - for npool := 1; npool <= m.Pool; npool++ { + // create child RP(s) with VMs + for childRP := 1; childRP <= m.Pool; childRP++ { spec := types.DefaultResourceConfigSpec() - _, err = pool.Create(ctx, m.fmtName(prefix, npool), spec) + p, err := rootRP.Create(ctx, m.fmtName(prefix, childRP), spec) + addMachine(m.fmtName(prefix, childRP), nil, p, folders) if err != nil { return err } @@ -438,7 +769,7 @@ func (m *Model) Create() error { vspec := NewVAppConfigSpec() name := m.fmtName(prefix, napp) - vapp, err := pool.CreateVApp(ctx, name, rspec, vspec, nil) + vapp, err := rootRP.CreateVApp(ctx, name, rspec, vspec, nil) if err != nil { return err } @@ -488,15 +819,21 @@ func (m *Model) Create() error { return nil } +func (m *Model) createTempDir(dc string, name string) (string, error) { + dir, err := ioutil.TempDir("", fmt.Sprintf("govcsim-%s-%s-", dc, name)) + if err == nil { + m.dirs = append(m.dirs, dir) + } + return dir, err +} + func (m *Model) createLocalDatastore(dc string, name string, hosts []*object.HostSystem) error { ctx := context.Background() - dir, err := ioutil.TempDir("", fmt.Sprintf("govcsim-%s-%s-", dc, name)) + dir, err := m.createTempDir(dc, name) if err != nil { return err } - m.dirs = append(m.dirs, dir) - for _, host := range hosts { dss, err := host.ConfigManager().DatastoreSystem(ctx) if err != nil { @@ -514,7 +851,117 @@ func (m *Model) createLocalDatastore(dc string, name string, hosts []*object.Hos // Remove cleans up items created by the Model, such as local datastore directories func (m *Model) Remove() { + // Remove associated vm containers, if any + Map.m.Lock() + for _, obj := range Map.objects { + if vm, ok := obj.(*VirtualMachine); ok { + vm.run.remove(vm) + } + } + Map.m.Unlock() + for _, dir := range m.dirs { _ = os.RemoveAll(dir) } } + +// Run calls f with a Client connected to a simulator server instance, which is stopped after f returns. +func (m *Model) Run(f func(context.Context, *vim25.Client) error) error { + ctx := context.Background() + + defer m.Remove() + + if m.Service == nil { + err := m.Create() + if err != nil { + return err + } + } + + m.Service.TLS = new(tls.Config) + m.Service.RegisterEndpoints = true + + s := m.Service.NewServer() + defer s.Close() + + c, err := govmomi.NewClient(ctx, s.URL, true) + if err != nil { + return err + } + + defer c.Logout(ctx) + + return f(ctx, c.Client) +} + +// Run calls Model.Run for each model and will panic if f returns an error. +// If no model is specified, the VPX Model is used by default. +func Run(f func(context.Context, *vim25.Client) error, model ...*Model) { + m := model + if len(m) == 0 { + m = []*Model{VPX()} + } + + for i := range m { + err := m[i].Run(f) + if err != nil { + panic(err) + } + } +} + +// Test calls Run and expects the caller propagate any errors, via testing.T for example. +func Test(f func(context.Context, *vim25.Client), model ...*Model) { + Run(func(ctx context.Context, c *vim25.Client) error { + f(ctx, c) + return nil + }, model...) +} + +// RunContainer runs a vm container with the given args +func RunContainer(ctx context.Context, c *vim25.Client, vm mo.Reference, args string) error { + obj, ok := vm.(*object.VirtualMachine) + if !ok { + obj = object.NewVirtualMachine(c, vm.Reference()) + } + + task, err := obj.PowerOff(ctx) + if err != nil { + return err + } + _ = task.Wait(ctx) // ignore InvalidPowerState if already off + + task, err = obj.Reconfigure(ctx, types.VirtualMachineConfigSpec{ + ExtraConfig: []types.BaseOptionValue{&types.OptionValue{Key: "RUN.container", Value: args}}, + }) + if err != nil { + return err + } + if err = task.Wait(ctx); err != nil { + return err + } + + task, err = obj.PowerOn(ctx) + if err != nil { + return err + } + return task.Wait(ctx) +} + +// delay sleeps according to DelayConfig. If no delay specified, returns immediately. +func (dc *DelayConfig) delay(method string) { + d := 0 + if dc.Delay > 0 { + d = dc.Delay + } + if md, ok := dc.MethodDelay[method]; ok { + d += md + } + if dc.DelayJitter > 0 { + d += int(rand.NormFloat64() * dc.DelayJitter * float64(d)) + } + if d > 0 { + //fmt.Printf("Delaying method %s %d ms\n", method, d) + time.Sleep(time.Duration(d) * time.Millisecond) + } +} diff --git a/vendor/github.com/vmware/govmomi/simulator/object.go b/vendor/github.com/vmware/govmomi/simulator/object.go index f9ac05bbc1f..b08be515f74 100644 --- a/vendor/github.com/vmware/govmomi/simulator/object.go +++ b/vendor/github.com/vmware/govmomi/simulator/object.go @@ -17,13 +17,17 @@ limitations under the License. package simulator import ( + "bytes" + + "github.com/google/uuid" + "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/soap" "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vim25/xml" ) func SetCustomValue(ctx *Context, req *types.SetCustomValue) soap.HasFault { - ctx.Caller = &req.This body := &methods.SetCustomValueBody{} cfm := Map.CustomFieldsManager() @@ -49,3 +53,28 @@ func SetCustomValue(ctx *Context, req *types.SetCustomValue) soap.HasFault { body.Res = &types.SetCustomValueResponse{} return body } + +// newUUID returns a stable UUID string based on input s +func newUUID(s string) string { + return sha1UUID(s).String() +} + +// sha1UUID returns a stable UUID based on input s +func sha1UUID(s string) uuid.UUID { + return uuid.NewSHA1(uuid.NameSpaceOID, []byte(s)) +} + +// deepCopy uses xml encode/decode to copy src to dst +func deepCopy(src, dst interface{}) { + b, err := xml.Marshal(src) + if err != nil { + panic(err) + } + + dec := xml.NewDecoder(bytes.NewReader(b)) + dec.TypeFunc = types.TypeFunc() + err = dec.Decode(dst) + if err != nil { + panic(err) + } +} diff --git a/vendor/github.com/vmware/govmomi/simulator/option_manager.go b/vendor/github.com/vmware/govmomi/simulator/option_manager.go index 4e2496775af..efcdee2153e 100644 --- a/vendor/github.com/vmware/govmomi/simulator/option_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/option_manager.go @@ -20,6 +20,8 @@ import ( "strings" "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/simulator/vpx" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/soap" @@ -39,6 +41,16 @@ func NewOptionManager(ref *types.ManagedObjectReference, setting []types.BaseOpt return s } +func (m *OptionManager) init(r *Registry) { + if len(m.Setting) == 0 { + if r.IsVPX() { + m.Setting = vpx.Setting + } else { + m.Setting = esx.Setting + } + } +} + func (m *OptionManager) QueryOptions(req *types.QueryOptions) soap.HasFault { body := &methods.QueryOptionsBody{} res := &types.QueryOptionsResponse{} diff --git a/vendor/github.com/vmware/govmomi/simulator/ovf_manager.go b/vendor/github.com/vmware/govmomi/simulator/ovf_manager.go new file mode 100644 index 00000000000..1540b4038e6 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/simulator/ovf_manager.go @@ -0,0 +1,292 @@ +/* +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 simulator + +import ( + "fmt" + "log" + "math" + "strconv" + "strings" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/ovf" + "github.com/vmware/govmomi/simulator/esx" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type OvfManager struct { + mo.OvfManager +} + +func ovfDisk(e *ovf.Envelope, diskID string) *ovf.VirtualDiskDesc { + for _, disk := range e.Disk.Disks { + if strings.HasSuffix(diskID, disk.DiskID) { + return &disk + } + } + return nil +} + +func ovfNetwork(ctx *Context, req *types.CreateImportSpec, item ovf.ResourceAllocationSettingData) types.BaseVirtualDeviceBackingInfo { + if len(item.Connection) == 0 { + return nil + } + pool := ctx.Map.Get(req.ResourcePool).(mo.Entity) + ref := ctx.Map.getEntityDatacenter(pool).defaultNetwork()[0] // Default to VM Network + c := item.Connection[0] + + for _, net := range req.Cisp.NetworkMapping { + if net.Name == c { + ref = net.Network + break + } + } + + switch obj := ctx.Map.Get(ref).(type) { + case *mo.Network: + return &types.VirtualEthernetCardNetworkBackingInfo{ + VirtualDeviceDeviceBackingInfo: types.VirtualDeviceDeviceBackingInfo{ + DeviceName: obj.Name, + }, + } + case *DistributedVirtualPortgroup: + dvs := ctx.Map.Get(*obj.Config.DistributedVirtualSwitch).(*DistributedVirtualSwitch) + return &types.VirtualEthernetCardDistributedVirtualPortBackingInfo{ + Port: types.DistributedVirtualSwitchPortConnection{ + PortgroupKey: obj.Key, + SwitchUuid: dvs.Config.GetDVSConfigInfo().Uuid, + }, + } + default: + log.Printf("ovf: unknown network type: %T", ref) + return nil + } +} + +func ovfDiskCapacity(disk *ovf.VirtualDiskDesc) int64 { + b, _ := strconv.ParseUint(disk.Capacity, 10, 64) + if disk.CapacityAllocationUnits == nil { + return int64(b) + } + c := strings.Fields(*disk.CapacityAllocationUnits) + if len(c) == 3 && c[0] == "byte" && c[1] == "*" { // "byte * 2^20" + p := strings.Split(c[2], "^") + x, _ := strconv.ParseUint(p[0], 10, 64) + if len(p) == 2 { + y, _ := strconv.ParseUint(p[1], 10, 64) + b *= uint64(math.Pow(float64(x), float64(y))) + } else { + b *= x + } + } + return int64(b / 1024) +} + +func (m *OvfManager) CreateImportSpec(ctx *Context, req *types.CreateImportSpec) soap.HasFault { + body := new(methods.CreateImportSpecBody) + + env, err := ovf.Unmarshal(strings.NewReader(req.OvfDescriptor)) + if err != nil { + body.Fault_ = Fault(err.Error(), &types.InvalidArgument{InvalidProperty: "ovfDescriptor"}) + return body + } + + ds := ctx.Map.Get(req.Datastore).(*Datastore) + path := object.DatastorePath{Datastore: ds.Name} + spec := &types.VirtualMachineImportSpec{ + ConfigSpec: types.VirtualMachineConfigSpec{ + Name: req.Cisp.EntityName, + Version: esx.HardwareVersion, + GuestId: string(types.VirtualMachineGuestOsIdentifierOtherGuest), + Files: &types.VirtualMachineFileInfo{ + VmPathName: path.String(), + }, + NumCPUs: 1, + NumCoresPerSocket: 1, + MemoryMB: 32, + }, + ResPoolEntity: &req.ResourcePool, + } + + if req.Cisp.DeploymentOption == "" && env.DeploymentOption != nil { + for _, c := range env.DeploymentOption.Configuration { + if isTrue(c.Default) { + req.Cisp.DeploymentOption = c.ID + break + } + } + } + + if os := env.VirtualSystem.OperatingSystem; len(os) != 0 { + if id := os[0].OSType; id != nil { + spec.ConfigSpec.GuestId = *id + } + } + + var device object.VirtualDeviceList + result := types.OvfCreateImportSpecResult{ + ImportSpec: spec, + } + + hw := env.VirtualSystem.VirtualHardware[0] + if vmx := hw.System.VirtualSystemType; vmx != nil { + spec.ConfigSpec.Version = *vmx + } + + ndisk := 0 + ndev := 0 + resources := make(map[string]types.BaseVirtualDevice) + + for _, item := range hw.Item { + if req.Cisp.DeploymentOption != "" && item.Configuration != nil { + if req.Cisp.DeploymentOption != *item.Configuration { + continue + } + } + + kind := func() string { + if item.ResourceSubType == nil { + return "unknown" + } + return strings.ToLower(*item.ResourceSubType) + } + + unsupported := func(err error) { + result.Error = append(result.Error, types.LocalizedMethodFault{ + Fault: &types.OvfUnsupportedType{ + Name: item.ElementName, + InstanceId: item.InstanceID, + DeviceType: int32(*item.ResourceType), + }, + LocalizedMessage: err.Error(), + }) + } + + upload := func(file ovf.File, c types.BaseVirtualDevice, n int) { + result.FileItem = append(result.FileItem, types.OvfFileItem{ + DeviceId: fmt.Sprintf("/%s/%s:%d", req.Cisp.EntityName, device.Type(c), n), + Path: file.Href, + Size: int64(file.Size), + CimType: int32(*item.ResourceType), + }) + } + + switch *item.ResourceType { + case 1: // VMCI + case 3: // Number of Virtual CPUs + spec.ConfigSpec.NumCPUs = int32(*item.VirtualQuantity) + case 4: // Memory Size + spec.ConfigSpec.MemoryMB = int64(*item.VirtualQuantity) + case 5: // IDE Controller + d, _ := device.CreateIDEController() + device = append(device, d) + resources[item.InstanceID] = d + case 6: // SCSI Controller + d, err := device.CreateSCSIController(kind()) + if err == nil { + device = append(device, d) + resources[item.InstanceID] = d + } else { + unsupported(err) + } + case 10: // Virtual Network + net := ovfNetwork(ctx, req, item) + if net != nil { + d, err := device.CreateEthernetCard(kind(), net) + if err == nil { + device = append(device, d) + } else { + unsupported(err) + } + } + case 14: // Floppy Drive + if device.PickController((*types.VirtualSIOController)(nil)) == nil { + c := &types.VirtualSIOController{} + c.Key = device.NewKey() + device = append(device, c) + } + d, err := device.CreateFloppy() + if err == nil { + device = append(device, d) + resources[item.InstanceID] = d + } else { + unsupported(err) + } + case 15: // CD/DVD + c, ok := resources[*item.Parent] + if !ok { + continue // Parent is unsupported() + } + d, _ := device.CreateCdrom(c.(*types.VirtualIDEController)) + if len(item.HostResource) != 0 { + for _, file := range env.References { + if strings.HasSuffix(item.HostResource[0], file.ID) { + path.Path = fmt.Sprintf("%s/_deviceImage%d.iso", req.Cisp.EntityName, ndev) + device.InsertIso(d, path.String()) + upload(file, d, ndev) + break + } + } + } + device = append(device, d) + ndev++ + case 17: // Virtual Disk + c, ok := resources[*item.Parent] + if !ok { + continue // Parent is unsupported() + } + path.Path = fmt.Sprintf("%s/disk-%d.vmdk", req.Cisp.EntityName, ndisk) + d := device.CreateDisk(c.(types.BaseVirtualController), ds.Reference(), path.String()) + d.VirtualDevice.DeviceInfo = &types.Description{ + Label: item.ElementName, + } + disk := ovfDisk(env, item.HostResource[0]) + for _, file := range env.References { + if file.ID == *disk.FileRef { + upload(file, d, ndisk) + break + } + } + d.CapacityInKB = ovfDiskCapacity(disk) + device = append(device, d) + ndisk++ + case 23: // USB Controller + case 24: // Video Card + default: + unsupported(fmt.Errorf("unsupported resource type: %d", *item.ResourceType)) + } + } + + spec.ConfigSpec.DeviceChange, _ = device.ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) + + for _, p := range req.Cisp.PropertyMapping { + spec.ConfigSpec.ExtraConfig = append(spec.ConfigSpec.ExtraConfig, &types.OptionValue{ + Key: p.Key, + Value: p.Value, + }) + } + + body.Res = &types.CreateImportSpecResponse{ + Returnval: result, + } + + return body +} diff --git a/vendor/github.com/vmware/govmomi/simulator/performance_manager.go b/vendor/github.com/vmware/govmomi/simulator/performance_manager.go index 994b8498c3d..2bd8bf5f6f1 100644 --- a/vendor/github.com/vmware/govmomi/simulator/performance_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/performance_manager.go @@ -21,7 +21,6 @@ import ( "strconv" "time" - "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/simulator/esx" "github.com/vmware/govmomi/simulator/vpx" "github.com/vmware/govmomi/vim25/methods" @@ -54,56 +53,45 @@ type PerformanceManager struct { metricData map[string]map[int32][]int64 } -func NewPerformanceManager(ref types.ManagedObjectReference) object.Reference { - m := &PerformanceManager{} - m.Self = ref - if Map.IsESX() { - m.PerfCounter = esx.PerfCounter[:] - m.hostMetrics = esx.HostMetrics[:] - m.vmMetrics = esx.VmMetrics[:] - m.rpMetrics = esx.ResourcePoolMetrics[:] +func (m *PerformanceManager) init(r *Registry) { + if r.IsESX() { + m.PerfCounter = esx.PerfCounter + m.hostMetrics = esx.HostMetrics + m.vmMetrics = esx.VmMetrics + m.rpMetrics = esx.ResourcePoolMetrics m.metricData = esx.MetricData } else { - m.PerfCounter = vpx.PerfCounter[:] - m.hostMetrics = vpx.HostMetrics[:] - m.vmMetrics = vpx.VmMetrics[:] - m.rpMetrics = vpx.ResourcePoolMetrics[:] - m.clusterMetrics = vpx.ClusterMetrics[:] - m.datastoreMetrics = vpx.DatastoreMetrics[:] - m.datacenterMetrics = vpx.DatacenterMetrics[:] + m.PerfCounter = vpx.PerfCounter + m.hostMetrics = vpx.HostMetrics + m.vmMetrics = vpx.VmMetrics + m.rpMetrics = vpx.ResourcePoolMetrics + m.clusterMetrics = vpx.ClusterMetrics + m.datastoreMetrics = vpx.DatastoreMetrics + m.datacenterMetrics = vpx.DatacenterMetrics m.metricData = vpx.MetricData } m.perfCounterIndex = make(map[int32]types.PerfCounterInfo, len(m.PerfCounter)) for _, p := range m.PerfCounter { m.perfCounterIndex[p.Key] = p } - return m } func (p *PerformanceManager) QueryPerfCounter(ctx *Context, req *types.QueryPerfCounter) soap.HasFault { body := new(methods.QueryPerfCounterBody) - body.Req = req + body.Res = new(types.QueryPerfCounterResponse) body.Res.Returnval = make([]types.PerfCounterInfo, len(req.CounterId)) for i, id := range req.CounterId { - if info, ok := p.perfCounterIndex[id]; !ok { - body.Fault_ = Fault("", &types.InvalidArgument{ - InvalidProperty: "CounterId", - }) - return body - } else { - body.Res.Returnval[i] = info - } + body.Res.Returnval[i] = p.perfCounterIndex[id] } return body } func (p *PerformanceManager) QueryPerfProviderSummary(ctx *Context, req *types.QueryPerfProviderSummary) soap.HasFault { body := new(methods.QueryPerfProviderSummaryBody) - body.Req = req body.Res = new(types.QueryPerfProviderSummaryResponse) // The entity must exist - if Map.Get(req.Entity) == nil { + if ctx.Map.Get(req.Entity) == nil { body.Fault_ = Fault("", &types.InvalidArgument{ InvalidProperty: "Entity", }) @@ -140,6 +128,8 @@ func (p *PerformanceManager) buildAvailablePerfMetricsQueryResponse(ids []types. r.Returnval = append(r.Returnval, types.PerfMetricId{CounterId: id.CounterId, Instance: id.Instance}) } } + // Add a CounterId without a corresponding PerfCounterInfo entry. See issue #2835 + r.Returnval = append(r.Returnval, types.PerfMetricId{CounterId: 10042}) return r } @@ -173,7 +163,6 @@ func (p *PerformanceManager) queryAvailablePerfMetric(entity types.ManagedObject func (p *PerformanceManager) QueryAvailablePerfMetric(ctx *Context, req *types.QueryAvailablePerfMetric) soap.HasFault { body := new(methods.QueryAvailablePerfMetricBody) - body.Req = req body.Res = p.queryAvailablePerfMetric(req.Entity, req.IntervalId) return body @@ -181,7 +170,6 @@ func (p *PerformanceManager) QueryAvailablePerfMetric(ctx *Context, req *types.Q func (p *PerformanceManager) QueryPerf(ctx *Context, req *types.QueryPerf) soap.HasFault { body := new(methods.QueryPerfBody) - body.Req = req body.Res = new(types.QueryPerfResponse) body.Res.Returnval = make([]types.BasePerfEntityMetricBase, len(req.QuerySpec)) diff --git a/vendor/github.com/vmware/govmomi/simulator/portgroup.go b/vendor/github.com/vmware/govmomi/simulator/portgroup.go index af93a50062b..a0973ae996d 100644 --- a/vendor/github.com/vmware/govmomi/simulator/portgroup.go +++ b/vendor/github.com/vmware/govmomi/simulator/portgroup.go @@ -27,7 +27,13 @@ type DistributedVirtualPortgroup struct { mo.DistributedVirtualPortgroup } -func (s *DistributedVirtualPortgroup) ReconfigureDVPortgroupTask(req *types.ReconfigureDVPortgroup_Task) soap.HasFault { +func (s *DistributedVirtualPortgroup) RenameTask(ctx *Context, req *types.Rename_Task) soap.HasFault { + canDup := s.DistributedVirtualPortgroup.Config.BackingType == string(types.DistributedVirtualPortgroupBackingTypeNsx) + + return RenameTask(ctx, s, req, canDup) +} + +func (s *DistributedVirtualPortgroup) ReconfigureDVPortgroupTask(ctx *Context, req *types.ReconfigureDVPortgroup_Task) soap.HasFault { task := CreateTask(s, "reconfigureDvPortgroup", func(t *Task) (types.AnyType, types.BaseMethodFault) { s.Config.DefaultPortConfig = req.Spec.DefaultPortConfig s.Config.NumPorts = req.Spec.NumPorts @@ -39,32 +45,34 @@ func (s *DistributedVirtualPortgroup) ReconfigureDVPortgroupTask(req *types.Reco s.Config.Policy = req.Spec.Policy s.Config.PortNameFormat = req.Spec.PortNameFormat s.Config.VmVnicNetworkResourcePoolKey = req.Spec.VmVnicNetworkResourcePoolKey + s.Config.LogicalSwitchUuid = req.Spec.LogicalSwitchUuid + s.Config.BackingType = req.Spec.BackingType return nil, nil }) return &methods.ReconfigureDVPortgroup_TaskBody{ Res: &types.ReconfigureDVPortgroup_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (s *DistributedVirtualPortgroup) DestroyTask(req *types.Destroy_Task) soap.HasFault { +func (s *DistributedVirtualPortgroup) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { task := CreateTask(s, "destroy", func(t *Task) (types.AnyType, types.BaseMethodFault) { - vswitch := Map.Get(*s.Config.DistributedVirtualSwitch).(*DistributedVirtualSwitch) - Map.RemoveReference(vswitch, &vswitch.Portgroup, s.Reference()) - Map.removeString(vswitch, &vswitch.Summary.PortgroupName, s.Name) + vswitch := ctx.Map.Get(*s.Config.DistributedVirtualSwitch).(*DistributedVirtualSwitch) + ctx.Map.RemoveReference(ctx, vswitch, &vswitch.Portgroup, s.Reference()) + ctx.Map.removeString(ctx, vswitch, &vswitch.Summary.PortgroupName, s.Name) - f := Map.getEntityParent(vswitch, "Folder").(*Folder) - f.removeChild(s.Reference()) + f := ctx.Map.getEntityParent(vswitch, "Folder").(*Folder) + folderRemoveChild(ctx, &f.Folder, s.Reference()) return nil, nil }) return &methods.Destroy_TaskBody{ Res: &types.Destroy_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } diff --git a/vendor/github.com/vmware/govmomi/simulator/property_collector.go b/vendor/github.com/vmware/govmomi/simulator/property_collector.go index 6bd1b9f7201..44112b5a228 100644 --- a/vendor/github.com/vmware/govmomi/simulator/property_collector.go +++ b/vendor/github.com/vmware/govmomi/simulator/property_collector.go @@ -27,6 +27,8 @@ import ( "time" "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/simulator/internal" + "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/soap" @@ -50,13 +52,14 @@ func NewPropertyCollector(ref types.ManagedObjectReference) object.Reference { var errMissingField = errors.New("missing field") var errEmptyField = errors.New("empty field") +var errInvalidField = errors.New("invalid field") func getObject(ctx *Context, ref types.ManagedObjectReference) (reflect.Value, bool) { var obj mo.Reference if ctx.Session == nil { // Even without permissions to access an object or specific fields, RetrieveProperties // returns an ObjectContent response as long as the object exists. See retrieveResult.add() - obj = Map.Get(ref) + obj = ctx.Map.Get(ref) } else { obj = ctx.Session.Get(ref) } @@ -137,9 +140,7 @@ func wrapValue(rval reflect.Value, rtype reflect.Type) interface{} { default: kind := rtype.Elem().Name() // Remove govmomi interface prefix name - if strings.HasPrefix(kind, "Base") { - kind = kind[4:] - } + kind = strings.TrimPrefix(kind, "Base") akind, _ := defaultMapType("ArrayOf" + kind) a := reflect.New(akind) a.Elem().FieldByName(kind).Set(rval) @@ -180,6 +181,11 @@ func fieldValue(rval reflect.Value, p string) (interface{}, error) { rval = rval.Elem() } + if kind == reflect.Slice { + // field of array field cannot be specified + return nil, errInvalidField + } + x := ucFirst(name) val := rval.FieldByName(x) if !val.IsValid() { @@ -231,7 +237,7 @@ func isTrue(v *bool) bool { } func isFalse(v *bool) bool { - return v == nil || *v == false + return v == nil || !*v } func lcFirst(s string) string { @@ -262,7 +268,7 @@ func (rr *retrieveResult) add(ctx *Context, name string, val types.AnyType, cont Path: name, Fault: types.LocalizedMethodFault{Fault: &types.NotAuthenticated{ NoPermission: types.NoPermission{ - Object: content.Obj, + Object: &content.Obj, PrivilegeId: "System.Read", }}, }, @@ -316,6 +322,13 @@ func (rr *retrieveResult) collectFields(ctx *Context, rval reflect.Value, fields Name: name, }}, }) + case errInvalidField: + content.MissingSet = append(content.MissingSet, types.MissingProperty{ + Path: name, + Fault: types.LocalizedMethodFault{Fault: &types.InvalidProperty{ + Name: name, + }}, + }) } } } @@ -331,8 +344,8 @@ func (rr *retrieveResult) collect(ctx *Context, ref types.ManagedObjectReference rval, ok := getObject(ctx, ref) if !ok { - // Possible if a test uses Map.Remove instead of Destroy_Task - log.Printf("object %s no longer exists", ref) + // Possible if a test uses ctx.Map.Remove instead of Destroy_Task + tracef("object %s no longer exists", ref) return } @@ -341,7 +354,7 @@ func (rr *retrieveResult) collect(ctx *Context, ref types.ManagedObjectReference for _, spec := range rr.req.SpecSet { for _, p := range spec.PropSet { - if p.Type != ref.Type { + if p.Type != ref.Type && p.Type != rtype.Name() { // e.g. ManagedEntity, ComputeResource field, ok := rtype.FieldByName(p.Type) @@ -485,8 +498,8 @@ func (pc *PropertyCollector) DestroyPropertyCollector(ctx *Context, c *types.Des filter.DestroyPropertyFilter(ctx, &types.DestroyPropertyFilter{This: ref}) } - ctx.Session.Remove(c.This) - ctx.Map.Remove(c.This) + ctx.Session.Remove(ctx, c.This) + ctx.Map.Remove(ctx, c.This) body.Res = &types.DestroyPropertyCollectorResponse{} @@ -579,7 +592,7 @@ func (pc *PropertyCollector) UpdateObject(o mo.Reference, changes []types.Proper }) } -func (pc *PropertyCollector) RemoveObject(ref types.ManagedObjectReference) { +func (pc *PropertyCollector) RemoveObject(_ *Context, ref types.ManagedObjectReference) { pc.update(types.ObjectUpdate{ Obj: ref, Kind: types.ObjectUpdateKindLeave, @@ -667,13 +680,13 @@ func (pc *PropertyCollector) WaitForUpdatesEx(ctx *Context, r *types.WaitForUpda } if r.Version == "" { + ctx.Map.AddHandler(pc) // Listen for create, update, delete of managed objects apply() // Collect current state set.Version = "-" // Next request with Version set will wait via loop below - ctx.Map.AddHandler(pc) // Listen for create, update, delete of managed objects return body } - ticker := time.NewTicker(250 * time.Millisecond) // allow for updates to accumulate + ticker := time.NewTicker(20 * time.Millisecond) // allow for updates to accumulate defer ticker.Stop() // Start the wait loop, returning on one of: // - Client calls CancelWaitForUpdates @@ -685,11 +698,11 @@ func (pc *PropertyCollector) WaitForUpdatesEx(ctx *Context, r *types.WaitForUpda body.Res.Returnval = nil switch wait.Err() { case context.Canceled: - log.Printf("%s: WaitForUpdates canceled", pc.Self) + tracef("%s: WaitForUpdates canceled", pc.Self) body.Fault_ = Fault("", new(types.RequestCanceled)) // CancelWaitForUpdates was called body.Res = nil case context.DeadlineExceeded: - log.Printf("%s: WaitForUpdates MaxWaitSeconds exceeded", pc.Self) + tracef("%s: WaitForUpdates MaxWaitSeconds exceeded", pc.Self) } return body @@ -699,14 +712,14 @@ func (pc *PropertyCollector) WaitForUpdatesEx(ctx *Context, r *types.WaitForUpda pc.updates = nil // clear updates collected by the managed object CRUD listeners pc.mu.Unlock() if len(updates) == 0 { - if oneUpdate == true { + if oneUpdate { body.Res.Returnval = nil return body } continue } - log.Printf("%s: applying %d updates to %d filters", pc.Self, len(updates), len(pc.Filter)) + tracef("%s: applying %d updates to %d filters", pc.Self, len(updates), len(pc.Filter)) for _, f := range pc.Filter { filter := ctx.Session.Get(f).(*PropertyFilter) @@ -719,7 +732,7 @@ func (pc *PropertyCollector) WaitForUpdatesEx(ctx *Context, r *types.WaitForUpda return body } case types.ObjectUpdateKindModify: // Update - log.Printf("%s has %d changes", update.Obj, len(update.ChangeSet)) + tracef("%s has %d changes", update.Obj, len(update.ChangeSet)) if !apply() { // An update may apply to collector traversal specs return body } @@ -747,7 +760,7 @@ func (pc *PropertyCollector) WaitForUpdatesEx(ctx *Context, r *types.WaitForUpda if len(set.FilterSet) != 0 { return body } - if oneUpdate == true { + if oneUpdate { body.Res.Returnval = nil return body } @@ -774,3 +787,68 @@ func (pc *PropertyCollector) WaitForUpdates(ctx *Context, r *types.WaitForUpdate return body } + +// Fetch is not documented in the vSphere SDK, but ovftool depends on it. +// A Fetch request is converted to a RetrievePropertiesEx method call by vcsim. +func (pc *PropertyCollector) Fetch(ctx *Context, req *internal.Fetch) soap.HasFault { + body := new(internal.FetchBody) + + if req.This == vim25.ServiceInstance && req.Prop == "content" { + content := ctx.Map.content() + // ovftool uses API version for 6.0 and fails when these fields are non-nil; TODO + content.VStorageObjectManager = nil + content.HostProfileManager = nil + content.HostSpecManager = nil + content.CryptoManager = nil + content.HostProfileManager = nil + content.HealthUpdateManager = nil + content.FailoverClusterConfigurator = nil + content.FailoverClusterManager = nil + body.Res = &internal.FetchResponse{ + Returnval: content, + } + return body + } + + if ctx.Map.Get(req.This) == nil { + // The Fetch method supports use of super class types, this is a quick hack to support the cases used by ovftool + switch req.This.Type { + case "ManagedEntity": + for o := range ctx.Map.objects { + if o.Value == req.This.Value { + req.This.Type = o.Type + break + } + } + case "ComputeResource": + req.This.Type = "Cluster" + req.This.Type + } + } + + res := pc.RetrievePropertiesEx(ctx, &types.RetrievePropertiesEx{ + SpecSet: []types.PropertyFilterSpec{{ + PropSet: []types.PropertySpec{{ + Type: req.This.Type, + PathSet: []string{req.Prop}, + }}, + ObjectSet: []types.ObjectSpec{{ + Obj: req.This, + }}, + }}}) + + if res.Fault() != nil { + return res + } + + obj := res.(*methods.RetrievePropertiesExBody).Res.Returnval.Objects[0] + if len(obj.PropSet) == 0 { + fault := obj.MissingSet[0].Fault + body.Fault_ = Fault(fault.LocalizedMessage, fault.Fault) + return body + } + + body.Res = &internal.FetchResponse{ + Returnval: obj.PropSet[0].Val, + } + return body +} diff --git a/vendor/github.com/vmware/govmomi/simulator/property_filter.go b/vendor/github.com/vmware/govmomi/simulator/property_filter.go index b7a4af5dadf..b84c85e7da3 100644 --- a/vendor/github.com/vmware/govmomi/simulator/property_filter.go +++ b/vendor/github.com/vmware/govmomi/simulator/property_filter.go @@ -38,7 +38,7 @@ func (f *PropertyFilter) DestroyPropertyFilter(ctx *Context, c *types.DestroyPro RemoveReference(&f.pc.Filter, c.This) - ctx.Session.Remove(c.This) + ctx.Session.Remove(ctx, c.This) body.Res = &types.DestroyPropertyFilterResponse{} diff --git a/vendor/github.com/vmware/govmomi/simulator/registry.go b/vendor/github.com/vmware/govmomi/simulator/registry.go index 91be876deb1..c91af59e2a8 100644 --- a/vendor/github.com/vmware/govmomi/simulator/registry.go +++ b/vendor/github.com/vmware/govmomi/simulator/registry.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2017-2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2017-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. @@ -19,14 +19,17 @@ package simulator import ( "encoding/json" "fmt" + "log" "os" "reflect" "strings" "sync" "sync/atomic" + "github.com/vmware/govmomi/simulator/internal" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" "github.com/vmware/govmomi/vim25/types" ) @@ -42,9 +45,16 @@ var refValueMap = map[string]string{ "VirtualMachineSnapshot": "snapshot", "VmwareDistributedVirtualSwitch": "dvs", "DistributedVirtualSwitch": "dvs", + "ClusterComputeResource": "domain-c", + "Folder": "group", + "StoragePod": "group-p", } // Map is the default Registry instance. +// +// TODO/WIP: To support the eventual removal of this unsyncronized global +// variable, the Map should be accessed through any Context.Map that is passed +// in to functions that may need it. var Map = NewRegistry() // RegisterObject interface supports callbacks when objects are created, updated and deleted from the Registry @@ -52,7 +62,7 @@ type RegisterObject interface { mo.Reference PutObject(mo.Reference) UpdateObject(mo.Reference, []types.PropertyChange) - RemoveObject(types.ManagedObjectReference) + RemoveObject(*Context, types.ManagedObjectReference) } // Registry manages a map of mo.Reference objects @@ -61,10 +71,11 @@ type Registry struct { m sync.Mutex objects map[types.ManagedObjectReference]mo.Reference handlers map[types.ManagedObjectReference]RegisterObject - locks map[types.ManagedObjectReference]sync.Locker + locks map[types.ManagedObjectReference]*internal.ObjectLock Namespace string Path string + Handler func(*Context, *Method) (mo.Reference, types.BaseMethodFault) tagManager tagManager } @@ -82,7 +93,7 @@ func NewRegistry() *Registry { r := &Registry{ objects: make(map[types.ManagedObjectReference]mo.Reference), handlers: make(map[types.ManagedObjectReference]RegisterObject), - locks: make(map[types.ManagedObjectReference]sync.Locker), + locks: make(map[types.ManagedObjectReference]*internal.ObjectLock), Namespace: vim25.Namespace, Path: vim25.Path, @@ -107,11 +118,16 @@ func typeName(item mo.Reference) string { // valuePrefix returns the value name prefix of a given object func valuePrefix(typeName string) string { - if v, ok := refValueMap[typeName]; ok { - return v + v, ok := refValueMap[typeName] + if ok { + if strings.Contains(v, "-") { + return v + } + } else { + v = strings.ToLower(typeName) } - return strings.ToLower(typeName) + return v + "-" } // newReference returns a new MOR, where Type defaults to type of the given item @@ -125,7 +141,7 @@ func (r *Registry) newReference(item mo.Reference) types.ManagedObjectReference if ref.Value == "" { n := atomic.AddInt64(&r.counter, 1) - ref.Value = fmt.Sprintf("%s-%d", valuePrefix(ref.Type), n) + ref.Value = fmt.Sprintf("%s%d", valuePrefix(ref.Type), n) } return ref @@ -143,6 +159,13 @@ func (r *Registry) AddHandler(h RegisterObject) { r.m.Unlock() } +// RemoveHandler removes a RegisterObject handler from the Registry. +func (r *Registry) RemoveHandler(h RegisterObject) { + r.m.Lock() + delete(r.handlers, h.Reference()) + r.m.Unlock() +} + // NewEntity sets Entity().Self with a new, unique Value. // Useful for creating object instances from templates. func (r *Registry) NewEntity(item mo.Entity) mo.Entity { @@ -205,6 +228,22 @@ func (r *Registry) All(kind string) []mo.Entity { return entities } +// AllReference returns all mo.Reference objects of type specified by kind. +// If kind is empty - all objects will be returned. +func (r *Registry) AllReference(kind string) []mo.Reference { + r.m.Lock() + defer r.m.Unlock() + + var objs []mo.Reference + for ref, val := range r.objects { + if kind == "" || ref.Type == kind { + objs = append(objs, val) + } + } + + return objs +} + // applyHandlers calls the given func for each r.handlers func (r *Registry) applyHandlers(f func(o RegisterObject)) { r.m.Lock() @@ -219,15 +258,18 @@ func (r *Registry) applyHandlers(f func(o RegisterObject)) { } } -// Put adds a new object to Registry, generating a ManagedObjectReference if not already set. -func (r *Registry) Put(item mo.Reference) mo.Reference { - r.m.Lock() - +func (r *Registry) reference(item mo.Reference) types.ManagedObjectReference { ref := item.Reference() if ref.Type == "" || ref.Value == "" { ref = r.newReference(item) r.setReference(item, ref) } + return ref +} + +// Put adds a new object to Registry, generating a ManagedObjectReference if not already set. +func (r *Registry) Put(item mo.Reference) mo.Reference { + r.m.Lock() if me, ok := item.(mo.Entity); ok { me.Entity().ConfigStatus = types.ManagedEntityStatusGreen @@ -235,7 +277,7 @@ func (r *Registry) Put(item mo.Reference) mo.Reference { me.Entity().EffectiveRole = []int32{-1} // Admin } - r.objects[ref] = item + r.objects[r.reference(item)] = item r.m.Unlock() @@ -247,9 +289,9 @@ func (r *Registry) Put(item mo.Reference) mo.Reference { } // Remove removes an object from the Registry. -func (r *Registry) Remove(item types.ManagedObjectReference) { +func (r *Registry) Remove(ctx *Context, item types.ManagedObjectReference) { r.applyHandlers(func(o RegisterObject) { - o.RemoveObject(item) + o.RemoveObject(ctx, item) }) r.m.Lock() @@ -283,15 +325,24 @@ func (r *Registry) Update(obj mo.Reference, changes []types.PropertyChange) { }) } +func (r *Registry) AtomicUpdate(ctx *Context, obj mo.Reference, changes []types.PropertyChange) { + r.WithLock(ctx, obj, func() { + r.Update(obj, changes) + }) +} + // getEntityParent traverses up the inventory and returns the first object of type kind. // If no object of type kind is found, the method will panic when it reaches the // inventory root Folder where the Parent field is nil. func (r *Registry) getEntityParent(item mo.Entity, kind string) mo.Entity { + var ok bool for { parent := item.Entity().Parent - item = r.Get(*parent).(mo.Entity) - + item, ok = r.Get(*parent).(mo.Entity) + if !ok { + return nil + } if item.Reference().Type == kind { return item } @@ -300,11 +351,15 @@ func (r *Registry) getEntityParent(item mo.Entity, kind string) mo.Entity { // getEntityDatacenter returns the Datacenter containing the given item func (r *Registry) getEntityDatacenter(item mo.Entity) *Datacenter { - return r.getEntityParent(item, "Datacenter").(*Datacenter) + dc, ok := r.getEntityParent(item, "Datacenter").(*Datacenter) + if ok { + return dc + } + return nil } -func (r *Registry) getEntityFolder(item mo.Entity, kind string) *Folder { - dc := Map.getEntityDatacenter(item) +func (r *Registry) getEntityFolder(item mo.Entity, kind string) *mo.Folder { + dc := r.getEntityDatacenter(item) var ref types.ManagedObjectReference @@ -313,12 +368,12 @@ func (r *Registry) getEntityFolder(item mo.Entity, kind string) *Folder { ref = dc.DatastoreFolder } - folder := r.Get(ref).(*Folder) + folder, _ := asFolderMO(r.Get(ref)) // If Model was created with Folder option, use that Folder; else use top-level folder for _, child := range folder.ChildEntity { if child.Type == "Folder" { - folder = Map.Get(child).(*Folder) + folder, _ = asFolderMO(r.Get(child)) break } } @@ -344,6 +399,31 @@ func (r *Registry) getEntityComputeResource(item mo.Entity) mo.Entity { } } +func entityName(e mo.Entity) string { + name := e.Entity().Name + if name != "" { + return name + } + + obj := getManagedObject(e).Addr().Interface() + + // The types below have their own 'Name' field, so ManagedEntity.Name (me.Name) is empty. + // See also mo.Ancestors + switch x := obj.(type) { + case *mo.Network: + return x.Name + case *mo.DistributedVirtualSwitch: + return x.Name + case *mo.DistributedVirtualPortgroup: + return x.Name + case *mo.OpaqueNetwork: + return x.Name + } + + log.Panicf("%T object %s does not have a Name", obj, e.Reference()) + return name +} + // FindByName returns the first mo.Entity of the given refs whose Name field is equal to the given name. // If there is no match, nil is returned. // This method is useful for cases where objects are required to have a unique name, such as Datastore with @@ -351,7 +431,7 @@ func (r *Registry) getEntityComputeResource(item mo.Entity) mo.Entity { func (r *Registry) FindByName(name string, refs []types.ManagedObjectReference) mo.Entity { for _, ref := range refs { if e, ok := r.Get(ref).(mo.Entity); ok { - if name == e.Entity().Name { + if name == entityName(e) { return e } } @@ -374,15 +454,15 @@ func FindReference(refs []types.ManagedObjectReference, match ...types.ManagedOb } // AppendReference appends the given refs to field. -func (r *Registry) AppendReference(obj mo.Reference, field *[]types.ManagedObjectReference, ref ...types.ManagedObjectReference) { - r.WithLock(obj, func() { +func (r *Registry) AppendReference(ctx *Context, obj mo.Reference, field *[]types.ManagedObjectReference, ref ...types.ManagedObjectReference) { + r.WithLock(ctx, obj, func() { *field = append(*field, ref...) }) } // AddReference appends ref to field if not already in the given field. -func (r *Registry) AddReference(obj mo.Reference, field *[]types.ManagedObjectReference, ref types.ManagedObjectReference) { - r.WithLock(obj, func() { +func (r *Registry) AddReference(ctx *Context, obj mo.Reference, field *[]types.ManagedObjectReference, ref types.ManagedObjectReference) { + r.WithLock(ctx, obj, func() { if FindReference(*field, ref) == nil { *field = append(*field, ref) } @@ -400,14 +480,14 @@ func RemoveReference(field *[]types.ManagedObjectReference, ref types.ManagedObj } // RemoveReference removes ref from the given field. -func (r *Registry) RemoveReference(obj mo.Reference, field *[]types.ManagedObjectReference, ref types.ManagedObjectReference) { - r.WithLock(obj, func() { +func (r *Registry) RemoveReference(ctx *Context, obj mo.Reference, field *[]types.ManagedObjectReference, ref types.ManagedObjectReference) { + r.WithLock(ctx, obj, func() { RemoveReference(field, ref) }) } -func (r *Registry) removeString(obj mo.Reference, field *[]string, val string) { - r.WithLock(obj, func() { +func (r *Registry) removeString(ctx *Context, obj mo.Reference, field *[]string, val string) { + r.WithLock(ctx, obj, func() { for i, name := range *field { if name == val { *field = append((*field)[:i], (*field)[i+1:]...) @@ -446,9 +526,20 @@ func (r *Registry) FileManager() *FileManager { return r.Get(r.content().FileManager.Reference()).(*FileManager) } +type VirtualDiskManagerInterface interface { + mo.Reference + MO() mo.VirtualDiskManager + CreateVirtualDiskTask(*Context, *types.CreateVirtualDisk_Task) soap.HasFault + DeleteVirtualDiskTask(*Context, *types.DeleteVirtualDisk_Task) soap.HasFault + MoveVirtualDiskTask(*Context, *types.MoveVirtualDisk_Task) soap.HasFault + CopyVirtualDiskTask(*Context, *types.CopyVirtualDisk_Task) soap.HasFault + QueryVirtualDiskUuid(*Context, *types.QueryVirtualDiskUuid) soap.HasFault + SetVirtualDiskUuid(*Context, *types.SetVirtualDiskUuid) soap.HasFault +} + // VirtualDiskManager returns the VirtualDiskManager singleton -func (r *Registry) VirtualDiskManager() *VirtualDiskManager { - return r.Get(r.content().VirtualDiskManager.Reference()).(*VirtualDiskManager) +func (r *Registry) VirtualDiskManager() VirtualDiskManagerInterface { + return r.Get(r.content().VirtualDiskManager.Reference()).(VirtualDiskManagerInterface) } // ViewManager returns the ViewManager singleton @@ -476,6 +567,11 @@ func (r *Registry) CustomFieldsManager() *CustomFieldsManager { return r.Get(r.content().CustomFieldsManager.Reference()).(*CustomFieldsManager) } +// TenantManager returns TenantManager singleton +func (r *Registry) TenantManager() *TenantManager { + return r.Get(r.content().TenantManager.Reference()).(*TenantManager) +} + func (r *Registry) MarshalJSON() ([]byte, error) { r.m.Lock() defer r.m.Unlock() @@ -491,7 +587,7 @@ func (r *Registry) MarshalJSON() ([]byte, error) { return json.Marshal(vars) } -func (r *Registry) locker(obj mo.Reference) sync.Locker { +func (r *Registry) locker(obj mo.Reference) *internal.ObjectLock { var ref types.ManagedObjectReference switch x := obj.(type) { @@ -502,17 +598,27 @@ func (r *Registry) locker(obj mo.Reference) sync.Locker { ref = *x obj = r.Get(ref) // to check for sync.Locker default: - ref = obj.Reference() + // Use of obj.Reference() may cause a read race, prefer the mo 'Self' field to avoid this + self := reflect.ValueOf(obj).Elem().FieldByName("Self") + if self.IsValid() { + ref = self.Interface().(types.ManagedObjectReference) + } else { + ref = obj.Reference() + } } if mu, ok := obj.(sync.Locker); ok { - return mu + // Objects that opt out of default locking are responsible for + // implementing their own lock sharing, if needed. Returning + // nil as heldBy means that WithLock will call Lock/Unlock + // every time. + return internal.NewObjectLock(mu) } r.m.Lock() mu, ok := r.locks[ref] if !ok { - mu = new(sync.Mutex) + mu = internal.NewObjectLock(new(sync.Mutex)) r.locks[ref] = mu } r.m.Unlock() @@ -523,13 +629,29 @@ func (r *Registry) locker(obj mo.Reference) sync.Locker { var enableLocker = os.Getenv("VCSIM_LOCKER") != "false" // WithLock holds a lock for the given object while then given function is run. -func (r *Registry) WithLock(obj mo.Reference, f func()) { - if enableLocker { - mu := r.locker(obj) - mu.Lock() - defer mu.Unlock() - } +func (r *Registry) WithLock(onBehalfOf *Context, obj mo.Reference, f func()) { + unlock := r.AcquireLock(onBehalfOf, obj) f() + unlock() +} + +// AcquireLock acquires the lock for onBehalfOf then returns. The lock MUST be +// released by calling the returned function. WithLock should be preferred +// wherever possible. +func (r *Registry) AcquireLock(onBehalfOf *Context, obj mo.Reference) func() { + if onBehalfOf == nil { + panic(fmt.Sprintf("Attempt to lock %v with nil onBehalfOf", obj)) + } + + if !enableLocker { + return func() {} + } + + l := r.locker(obj) + l.Acquire(onBehalfOf) + return func() { + l.Release(onBehalfOf) + } } // nopLocker can be embedded to opt-out of auto-locking (see Registry.WithLock) diff --git a/vendor/github.com/vmware/govmomi/simulator/resource_pool.go b/vendor/github.com/vmware/govmomi/simulator/resource_pool.go index 81b909ae6cb..a5f5a9aa25d 100644 --- a/vendor/github.com/vmware/govmomi/simulator/resource_pool.go +++ b/vendor/github.com/vmware/govmomi/simulator/resource_pool.go @@ -18,8 +18,11 @@ package simulator import ( "fmt" + "net/url" + "path" "strings" + "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/simulator/esx" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" @@ -31,6 +34,11 @@ type ResourcePool struct { mo.ResourcePool } +func asResourcePoolMO(obj mo.Reference) (*mo.ResourcePool, bool) { + rp, ok := getManagedObject(obj).Addr().Interface().(*mo.ResourcePool) + return rp, ok +} + func NewResourcePool() *ResourcePool { pool := &ResourcePool{ ResourcePool: esx.ResourcePool, @@ -186,6 +194,90 @@ func (p *ResourcePool) UpdateConfig(c *types.UpdateConfig) soap.HasFault { return body } +func (a *VirtualApp) ImportVApp(ctx *Context, req *types.ImportVApp) soap.HasFault { + return (&ResourcePool{ResourcePool: a.ResourcePool}).ImportVApp(ctx, req) +} + +func (p *ResourcePool) ImportVApp(ctx *Context, req *types.ImportVApp) soap.HasFault { + body := new(methods.ImportVAppBody) + + spec, ok := req.Spec.(*types.VirtualMachineImportSpec) + if !ok { + body.Fault_ = Fault(fmt.Sprintf("%T: type not supported", spec), &types.InvalidArgument{InvalidProperty: "spec"}) + return body + } + + dc := ctx.Map.getEntityDatacenter(p) + folder := ctx.Map.Get(dc.VmFolder).(*Folder) + if req.Folder != nil { + if p.Self.Type == "VirtualApp" { + body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "pool"}) + return body + } + folder = ctx.Map.Get(*req.Folder).(*Folder) + } + + res := folder.CreateVMTask(ctx, &types.CreateVM_Task{ + This: folder.Self, + Config: spec.ConfigSpec, + Pool: p.Self, + Host: req.Host, + }) + + ctask := ctx.Map.Get(res.(*methods.CreateVM_TaskBody).Res.Returnval).(*Task) + ctask.Wait() + + if ctask.Info.Error != nil { + body.Fault_ = Fault("", ctask.Info.Error.Fault) + return body + } + + lease := NewHttpNfcLease(ctx, ctask.Info.Result.(types.ManagedObjectReference)) + ref := lease.Reference() + lease.Info.Lease = ref + + vm := ctx.Map.Get(lease.Info.Entity).(*VirtualMachine) + device := object.VirtualDeviceList(vm.Config.Hardware.Device) + ndevice := make(map[string]int) + for _, d := range device { + info, ok := d.GetVirtualDevice().Backing.(types.BaseVirtualDeviceFileBackingInfo) + if !ok { + continue + } + var file object.DatastorePath + file.FromString(info.GetVirtualDeviceFileBackingInfo().FileName) + name := path.Base(file.Path) + ds := vm.findDatastore(file.Datastore) + lease.files[name] = path.Join(ds.Info.GetDatastoreInfo().Url, file.Path) + + _, disk := d.(*types.VirtualDisk) + kind := device.Type(d) + n := ndevice[kind] + ndevice[kind]++ + + lease.Info.DeviceUrl = append(lease.Info.DeviceUrl, types.HttpNfcLeaseDeviceUrl{ + Key: fmt.Sprintf("/%s/%s:%d", vm.Self.Value, kind, n), + ImportKey: fmt.Sprintf("/%s/%s:%d", vm.Name, kind, n), + Url: (&url.URL{ + Scheme: "https", + Host: "*", + Path: nfcPrefix + path.Join(ref.Value, name), + }).String(), + SslThumbprint: "", + Disk: types.NewBool(disk), + TargetId: name, + DatastoreKey: "", + FileSize: 0, + }) + } + + body.Res = &types.ImportVAppResponse{ + Returnval: ref, + } + + return body +} + type VirtualApp struct { mo.VirtualApp } @@ -253,10 +345,9 @@ func (p *ResourcePool) CreateVApp(req *types.CreateVApp) soap.HasFault { } func (a *VirtualApp) CreateChildVMTask(ctx *Context, req *types.CreateChildVM_Task) soap.HasFault { - ctx.Caller = &a.Self body := &methods.CreateChildVM_TaskBody{} - folder := Map.Get(*a.ParentFolder).(*Folder) + folder := ctx.Map.Get(*a.ParentFolder).(*Folder) res := folder.CreateVMTask(ctx, &types.CreateVM_Task{ This: folder.Self, @@ -272,43 +363,120 @@ func (a *VirtualApp) CreateChildVMTask(ctx *Context, req *types.CreateChildVM_Ta return body } -func (a *VirtualApp) DestroyTask(req *types.Destroy_Task) soap.HasFault { - return (&ResourcePool{ResourcePool: a.ResourcePool}).DestroyTask(req) +func (a *VirtualApp) CloneVAppTask(ctx *Context, req *types.CloneVApp_Task) soap.HasFault { + task := CreateTask(a, "cloneVapp", func(t *Task) (types.AnyType, types.BaseMethodFault) { + folder := req.Spec.VmFolder + if folder == nil { + folder = a.ParentFolder + } + + rspec := req.Spec.ResourceSpec + if rspec == nil { + s := types.DefaultResourceConfigSpec() + rspec = &s + } + + res := a.CreateVApp(&types.CreateVApp{ + This: a.Self, + Name: req.Name, + ResSpec: *rspec, + ConfigSpec: types.VAppConfigSpec{}, + VmFolder: folder, + }) + + if res.Fault() != nil { + return nil, res.Fault().VimFault().(types.BaseMethodFault) + } + + target := res.(*methods.CreateVAppBody).Res.Returnval + + for _, ref := range a.Vm { + vm := ctx.Map.Get(ref).(*VirtualMachine) + + res := vm.CloneVMTask(ctx, &types.CloneVM_Task{ + This: ref, + Folder: *folder, + Name: req.Name, + Spec: types.VirtualMachineCloneSpec{ + Location: types.VirtualMachineRelocateSpec{ + Pool: &target, + Host: req.Spec.Host, + }, + }, + }) + + ctask := ctx.Map.Get(res.(*methods.CloneVM_TaskBody).Res.Returnval).(*Task) + ctask.Wait() + if ctask.Info.Error != nil { + return nil, ctask.Info.Error.Fault + } + } + + return target, nil + }) + + return &methods.CloneVApp_TaskBody{ + Res: &types.CloneVApp_TaskResponse{ + Returnval: task.Run(ctx), + }, + } } -func (p *ResourcePool) DestroyTask(req *types.Destroy_Task) soap.HasFault { +func (a *VirtualApp) CreateVApp(req *types.CreateVApp) soap.HasFault { + return (&ResourcePool{ResourcePool: a.ResourcePool}).CreateVApp(req) +} + +func (a *VirtualApp) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { + return (&ResourcePool{ResourcePool: a.ResourcePool}).DestroyTask(ctx, req) +} + +func (p *ResourcePool) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { task := CreateTask(p, "destroy", func(t *Task) (types.AnyType, types.BaseMethodFault) { if strings.HasSuffix(p.Parent.Type, "ComputeResource") { // Can't destroy the root pool return nil, &types.InvalidArgument{} } - pp := Map.Get(*p.Parent).(*ResourcePool) + parent, _ := asResourcePoolMO(ctx.Map.Get(*p.Parent)) - parent := &pp.ResourcePool // Remove child reference from rp - Map.RemoveReference(parent, &parent.ResourcePool, req.This) + ctx.WithLock(parent, func() { + RemoveReference(&parent.ResourcePool, req.This) - // The grandchildren become children of the parent (rp) - Map.AppendReference(parent, &parent.ResourcePool, p.ResourcePool.ResourcePool...) + // The grandchildren become children of the parent (rp) + parent.ResourcePool = append(parent.ResourcePool, p.ResourcePool.ResourcePool...) + }) // And VMs move to the parent vms := p.ResourcePool.Vm for _, ref := range vms { - vm := Map.Get(ref).(*VirtualMachine) - Map.WithLock(vm, func() { vm.ResourcePool = &parent.Self }) + vm := ctx.Map.Get(ref).(*VirtualMachine) + ctx.WithLock(vm, func() { vm.ResourcePool = &parent.Self }) } - Map.AppendReference(parent, &parent.Vm, vms...) + ctx.WithLock(parent, func() { + parent.Vm = append(parent.Vm, vms...) + }) - Map.Remove(req.This) + ctx.Map.Remove(ctx, req.This) return nil, nil }) return &methods.Destroy_TaskBody{ Res: &types.Destroy_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } + +func (p *ResourcePool) DestroyChildren(ctx *Context, req *types.DestroyChildren) soap.HasFault { + walk(p, func(child types.ManagedObjectReference) { + if child.Type != "ResourcePool" { + return + } + ctx.Map.Get(child).(*ResourcePool).DestroyTask(ctx, &types.Destroy_Task{This: child}) + }) + + return &methods.DestroyChildrenBody{Res: new(types.DestroyChildrenResponse)} +} diff --git a/vendor/github.com/vmware/govmomi/simulator/search_index.go b/vendor/github.com/vmware/govmomi/simulator/search_index.go index d7fff71cabe..96e296274f8 100644 --- a/vendor/github.com/vmware/govmomi/simulator/search_index.go +++ b/vendor/github.com/vmware/govmomi/simulator/search_index.go @@ -19,7 +19,6 @@ package simulator import ( "strings" - "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/soap" @@ -30,17 +29,14 @@ type SearchIndex struct { mo.SearchIndex } -func NewSearchIndex(ref types.ManagedObjectReference) object.Reference { - m := &SearchIndex{} - m.Self = ref - return m -} - func (s *SearchIndex) FindByDatastorePath(r *types.FindByDatastorePath) soap.HasFault { res := &methods.FindByDatastorePathBody{Res: new(types.FindByDatastorePathResponse)} + Map.m.Lock() + defer Map.m.Unlock() + for ref, obj := range Map.objects { - vm, ok := obj.(*VirtualMachine) + vm, ok := asVirtualMachineMO(obj) if !ok { continue } @@ -128,10 +124,13 @@ func (s *SearchIndex) FindChild(req *types.FindChild) soap.HasFault { func (s *SearchIndex) FindByUuid(req *types.FindByUuid) soap.HasFault { body := &methods.FindByUuidBody{Res: new(types.FindByUuidResponse)} + Map.m.Lock() + defer Map.m.Unlock() + if req.VmSearch { // Find Virtual Machine using UUID for ref, obj := range Map.objects { - vm, ok := obj.(*VirtualMachine) + vm, ok := asVirtualMachineMO(obj) if !ok { continue } @@ -150,7 +149,7 @@ func (s *SearchIndex) FindByUuid(req *types.FindByUuid) soap.HasFault { } else { // Find Host System using UUID for ref, obj := range Map.objects { - host, ok := obj.(*HostSystem) + host, ok := asHostSystemMO(obj) if !ok { continue } @@ -184,10 +183,13 @@ func (s *SearchIndex) FindByDnsName(req *types.FindByDnsName) soap.HasFault { func (s *SearchIndex) FindAllByDnsName(req *types.FindAllByDnsName) soap.HasFault { body := &methods.FindAllByDnsNameBody{Res: new(types.FindAllByDnsNameResponse)} + Map.m.Lock() + defer Map.m.Unlock() + if req.VmSearch { // Find Virtual Machine using DNS name for ref, obj := range Map.objects { - vm, ok := obj.(*VirtualMachine) + vm, ok := asVirtualMachineMO(obj) if !ok { continue } @@ -198,7 +200,7 @@ func (s *SearchIndex) FindAllByDnsName(req *types.FindAllByDnsName) soap.HasFaul } else { // Find Host System using DNS name for ref, obj := range Map.objects { - host, ok := obj.(*HostSystem) + host, ok := asHostSystemMO(obj) if !ok { continue } @@ -233,10 +235,13 @@ func (s *SearchIndex) FindByIp(req *types.FindByIp) soap.HasFault { func (s *SearchIndex) FindAllByIp(req *types.FindAllByIp) soap.HasFault { body := &methods.FindAllByIpBody{Res: new(types.FindAllByIpResponse)} + Map.m.Lock() + defer Map.m.Unlock() + if req.VmSearch { // Find Virtual Machine using IP for ref, obj := range Map.objects { - vm, ok := obj.(*VirtualMachine) + vm, ok := asVirtualMachineMO(obj) if !ok { continue } @@ -247,7 +252,7 @@ func (s *SearchIndex) FindAllByIp(req *types.FindAllByIp) soap.HasFault { } else { // Find Host System using IP for ref, obj := range Map.objects { - host, ok := obj.(*HostSystem) + host, ok := asHostSystemMO(obj) if !ok { continue } diff --git a/vendor/github.com/vmware/govmomi/simulator/service_instance.go b/vendor/github.com/vmware/govmomi/simulator/service_instance.go index 8e632ada9c8..3524d154990 100644 --- a/vendor/github.com/vmware/govmomi/simulator/service_instance.go +++ b/vendor/github.com/vmware/govmomi/simulator/service_instance.go @@ -20,8 +20,8 @@ import ( "time" "github.com/google/uuid" - "github.com/vmware/govmomi/object" - "github.com/vmware/govmomi/simulator/vpx" + + "github.com/vmware/govmomi/simulator/internal" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" @@ -33,8 +33,11 @@ type ServiceInstance struct { mo.ServiceInstance } -func NewServiceInstance(content types.ServiceContent, folder mo.Folder) *ServiceInstance { +func NewServiceInstance(ctx *Context, content types.ServiceContent, folder mo.Folder) *ServiceInstance { + // TODO: This function ignores the passed in Map and operates on the + // global Map. Map = NewRegistry() + ctx.Map = Map s := &ServiceInstance{} @@ -46,52 +49,23 @@ func NewServiceInstance(content types.ServiceContent, folder mo.Folder) *Service f := &Folder{Folder: folder} Map.Put(f) - var setting []types.BaseOptionValue - if content.About.ApiType == "HostAgent" { - CreateDefaultESX(f) + CreateDefaultESX(ctx, f) } else { content.About.InstanceUuid = uuid.New().String() - setting = vpx.Setting } - objects := []object.Reference{ - NewSessionManager(*s.Content.SessionManager), - NewAuthorizationManager(*s.Content.AuthorizationManager), - NewPerformanceManager(*s.Content.PerfManager), - NewPropertyCollector(s.Content.PropertyCollector), - NewFileManager(*s.Content.FileManager), - NewVirtualDiskManager(*s.Content.VirtualDiskManager), - NewLicenseManager(*s.Content.LicenseManager), - NewSearchIndex(*s.Content.SearchIndex), - NewViewManager(*s.Content.ViewManager), - NewEventManager(*s.Content.EventManager), - NewTaskManager(*s.Content.TaskManager), - NewUserDirectory(*s.Content.UserDirectory), - NewOptionManager(s.Content.Setting, setting), - NewStorageResourceManager(*s.Content.StorageResourceManager), - } + refs := mo.References(content) - switch content.VStorageObjectManager.Type { - case "HostVStorageObjectManager": - // TODO: NewHostVStorageObjectManager(*content.VStorageObjectManager) - case "VcenterVStorageObjectManager": - objects = append(objects, NewVcenterVStorageObjectManager(*content.VStorageObjectManager)) - } - - if s.Content.CustomFieldsManager != nil { - objects = append(objects, NewCustomFieldsManager(*s.Content.CustomFieldsManager)) - } - - if s.Content.IpPoolManager != nil { - objects = append(objects, NewIpPoolManager(*s.Content.IpPoolManager)) - } - - if s.Content.AccountManager != nil { - objects = append(objects, NewHostLocalAccountManager(*s.Content.AccountManager)) - } - - for _, o := range objects { + for i := range refs { + if Map.Get(refs[i]) != nil { + continue + } + content := types.ObjectContent{Obj: refs[i]} + o, err := loadObject(content) + if err != nil { + panic(err) + } Map.Put(o) } @@ -113,3 +87,13 @@ func (*ServiceInstance) CurrentTime(*types.CurrentTime) soap.HasFault { }, } } + +func (s *ServiceInstance) RetrieveInternalContent(*internal.RetrieveInternalContent) soap.HasFault { + return &internal.RetrieveInternalContentBody{ + Res: &internal.RetrieveInternalContentResponse{ + Returnval: internal.InternalServiceInstanceContent{ + NfcService: types.ManagedObjectReference{Type: "NfcService", Value: "NfcService"}, + }, + }, + } +} diff --git a/vendor/github.com/vmware/govmomi/simulator/session_manager.go b/vendor/github.com/vmware/govmomi/simulator/session_manager.go index a9c5e112a1f..169ea3c41c2 100644 --- a/vendor/github.com/vmware/govmomi/simulator/session_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/session_manager.go @@ -20,11 +20,14 @@ import ( "context" "fmt" "net/http" + "os" + "reflect" "strings" + "sync" "time" "github.com/google/uuid" - "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/session" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" @@ -34,20 +37,30 @@ import ( type SessionManager struct { mo.SessionManager + nopLocker ServiceHostName string + TLSCert func() string sessions map[string]Session } -func NewSessionManager(ref types.ManagedObjectReference) object.Reference { - s := &SessionManager{ - sessions: make(map[string]Session), - } - s.Self = ref - return s +func (m *SessionManager) init(*Registry) { + m.sessions = make(map[string]Session) } +var ( + // SessionIdleTimeout duration used to expire idle sessions + SessionIdleTimeout time.Duration + + sessionMutex sync.Mutex + + // secureCookies enables Set-Cookie.Secure=true + // We can't do this by default as simulator.Service defaults to no TLS by default and + // Go's cookiejar does not send Secure cookies unless the URL scheme is https. + secureCookies = os.Getenv("VCSIM_SECURE_COOKIES") == "true" +) + func createSession(ctx *Context, name string, locale string) types.UserSession { now := time.Now().UTC() @@ -57,31 +70,63 @@ func createSession(ctx *Context, name string, locale string) types.UserSession { session := Session{ UserSession: types.UserSession{ - Key: uuid.New().String(), - UserName: name, - FullName: name, - LoginTime: now, - LastActiveTime: now, - Locale: locale, - MessageLocale: locale, + Key: uuid.New().String(), + UserName: name, + FullName: name, + LoginTime: now, + LastActiveTime: now, + Locale: locale, + MessageLocale: locale, + ExtensionSession: types.NewBool(false), }, Registry: NewRegistry(), } ctx.SetSession(session, true) - return session.UserSession + return ctx.Session.UserSession +} + +func (m *SessionManager) getSession(id string) (Session, bool) { + sessionMutex.Lock() + defer sessionMutex.Unlock() + s, ok := m.sessions[id] + return s, ok +} + +func (m *SessionManager) delSession(id string) { + sessionMutex.Lock() + defer sessionMutex.Unlock() + delete(m.sessions, id) +} + +func (m *SessionManager) putSession(s Session) { + sessionMutex.Lock() + defer sessionMutex.Unlock() + m.sessions[s.Key] = s +} + +func (s *SessionManager) validLogin(ctx *Context, req *types.Login) bool { + if ctx.Session != nil { + return false + } + user := ctx.svc.Listen.User + if user == nil || user == DefaultLogin { + return req.UserName != "" && req.Password != "" + } + pass, _ := user.Password() + return req.UserName == user.Username() && req.Password == pass } func (s *SessionManager) Login(ctx *Context, req *types.Login) soap.HasFault { body := new(methods.LoginBody) - if req.UserName == "" || req.Password == "" || ctx.Session != nil { - body.Fault_ = invalidLogin - } else { + if s.validLogin(ctx, req) { body.Res = &types.LoginResponse{ Returnval: createSession(ctx, req.UserName, req.Locale), } + } else { + body.Fault_ = invalidLogin } return body @@ -135,15 +180,15 @@ func (s *SessionManager) LoginByToken(ctx *Context, req *types.LoginByToken) soa func (s *SessionManager) Logout(ctx *Context, _ *types.Logout) soap.HasFault { session := ctx.Session - delete(s.sessions, session.Key) - pc := Map.content().PropertyCollector + s.delSession(session.Key) + pc := ctx.Map.content().PropertyCollector for ref, obj := range ctx.Session.Registry.objects { if ref == pc { continue // don't unregister the PropertyCollector singleton } if _, ok := obj.(RegisterObject); ok { - ctx.Map.Remove(ref) // Remove RegisterObject handlers + ctx.Map.Remove(ctx, ref) // Remove RegisterObject handlers } } @@ -165,7 +210,11 @@ func (s *SessionManager) TerminateSession(ctx *Context, req *types.TerminateSess body.Fault_ = Fault("", new(types.InvalidArgument)) return body } - delete(s.sessions, id) + if _, ok := s.getSession(id); !ok { + body.Fault_ = Fault("", new(types.NotFound)) + return body + } + s.delSession(id) } body.Res = new(types.TerminateSessionResponse) @@ -182,7 +231,7 @@ func (s *SessionManager) SessionIsActive(ctx *Context, req *types.SessionIsActiv body.Res = new(types.SessionIsActiveResponse) - if session, exists := s.sessions[req.SessionID]; exists { + if session, exists := s.getSession(req.SessionID); exists { body.Res.Returnval = session.UserName == req.UserName } @@ -192,7 +241,7 @@ func (s *SessionManager) SessionIsActive(ctx *Context, req *types.SessionIsActiv func (s *SessionManager) AcquireCloneTicket(ctx *Context, _ *types.AcquireCloneTicket) soap.HasFault { session := *ctx.Session session.Key = uuid.New().String() - s.sessions[session.Key] = session + s.putSession(session) return &methods.AcquireCloneTicketBody{ Res: &types.AcquireCloneTicketResponse{ @@ -204,10 +253,10 @@ func (s *SessionManager) AcquireCloneTicket(ctx *Context, _ *types.AcquireCloneT func (s *SessionManager) CloneSession(ctx *Context, ticket *types.CloneSession) soap.HasFault { body := new(methods.CloneSessionBody) - session, exists := s.sessions[ticket.CloneTicket] + session, exists := s.getSession(ticket.CloneTicket) if exists { - delete(s.sessions, ticket.CloneTicket) // A clone ticket can only be used once + s.delSession(ticket.CloneTicket) // A clone ticket can only be used once session.Key = uuid.New().String() ctx.SetSession(session, true) @@ -232,18 +281,6 @@ func (s *SessionManager) AcquireGenericServiceTicket(ticket *types.AcquireGeneri } } -// internalContext is the session for use by the in-memory client (Service.RoundTrip) -var internalContext = &Context{ - Context: context.Background(), - Session: &Session{ - UserSession: types.UserSession{ - Key: uuid.New().String(), - }, - Registry: NewRegistry(), - }, - Map: Map, -} - var invalidLogin = Fault("Login failure", new(types.InvalidLogin)) // Context provides per-request Session management. @@ -262,25 +299,64 @@ type Context struct { // mapSession maps an HTTP cookie to a Session. func (c *Context) mapSession() { if cookie, err := c.req.Cookie(soap.SessionCookieName); err == nil { - if val, ok := c.svc.sm.sessions[cookie.Value]; ok { + if val, ok := c.svc.sm.getSession(cookie.Value); ok { c.SetSession(val, false) } } } +func (m *SessionManager) expiredSession(id string, now time.Time) bool { + expired := true + + s, ok := m.getSession(id) + if ok { + expired = now.Sub(s.LastActiveTime) > SessionIdleTimeout + if expired { + m.delSession(id) + } + } + + return expired +} + +// SessionIdleWatch starts a goroutine that calls func expired() at SessionIdleTimeout intervals. +// The goroutine exits if the func returns true. +func SessionIdleWatch(ctx context.Context, id string, expired func(string, time.Time) bool) { + if SessionIdleTimeout == 0 { + return + } + + go func() { + for t := time.NewTimer(SessionIdleTimeout); ; { + select { + case <-ctx.Done(): + return + case now := <-t.C: + if expired(id, now) { + return + } + t.Reset(SessionIdleTimeout) + } + } + }() +} + // SetSession should be called after successful authentication. func (c *Context) SetSession(session Session, login bool) { session.UserAgent = c.req.UserAgent() session.IpAddress = strings.Split(c.req.RemoteAddr, ":")[0] session.LastActiveTime = time.Now() + session.CallCount++ - c.svc.sm.sessions[session.Key] = session + c.svc.sm.putSession(session) c.Session = &session if login { http.SetCookie(c.res, &http.Cookie{ - Name: soap.SessionCookieName, - Value: session.Key, + Name: soap.SessionCookieName, + Value: session.Key, + Secure: secureCookies, + HttpOnly: true, }) c.postEvent(&types.UserLoginSessionEvent{ @@ -289,22 +365,26 @@ func (c *Context) SetSession(session Session, login bool) { UserAgent: session.UserAgent, Locale: session.Locale, }) + + SessionIdleWatch(c.Context, session.Key, c.svc.sm.expiredSession) } } -// WithLock holds a lock for the given object while then given function is run. +// WithLock holds a lock for the given object while the given function is run. +// It will skip locking if this context already holds the given object's lock. func (c *Context) WithLock(obj mo.Reference, f func()) { - if c.Caller != nil && *c.Caller == obj.Reference() { - // Internal method invocation, obj is already locked - f() - return - } - Map.WithLock(obj, f) + // TODO: This is not always going to be correct. An object should + // really be locked by the registry that "owns it", which is not always + // Map. This function will need to take the Registry as an additional + // argument to accomplish this. + // Basic mutex locking will work even if obj doesn't belong to Map, but + // if obj implements sync.Locker, that custom locking will not be used. + c.Map.WithLock(c, obj, f) } // postEvent wraps EventManager.PostEvent for internal use, with a lock on the EventManager. func (c *Context) postEvent(events ...types.BaseEvent) { - m := Map.EventManager() + m := c.Map.EventManager() c.WithLock(m, func() { for _, event := range events { m.PostEvent(c, &types.PostEvent{EventToPost: event}) @@ -318,13 +398,20 @@ type Session struct { *Registry } -// Put wraps Registry.Put, setting the moref value to include the session key. -func (s *Session) Put(item mo.Reference) mo.Reference { +func (s *Session) setReference(item mo.Reference) { ref := item.Reference() if ref.Value == "" { ref.Value = fmt.Sprintf("session[%s]%s", s.Key, uuid.New()) } + if ref.Type == "" { + ref.Type = typeName(item) + } s.Registry.setReference(item, ref) +} + +// Put wraps Registry.Put, setting the moref value to include the session key. +func (s *Session) Put(item mo.Reference) mo.Reference { + s.setReference(item) return s.Registry.Put(item) } @@ -343,14 +430,22 @@ func (s *Session) Get(ref types.ManagedObjectReference) mo.Reference { m.CurrentSession = &s.UserSession // TODO: we could maintain SessionList as part of the SessionManager singleton + sessionMutex.Lock() for _, session := range m.sessions { m.SessionList = append(m.SessionList, session.UserSession) } + sessionMutex.Unlock() return &m case "PropertyCollector": if ref == Map.content().PropertyCollector { - return s.Put(NewPropertyCollector(ref)) + // Per-session instance of the PropertyCollector singleton. + // Using reflection here as PropertyCollector might be wrapped with a custom type. + obj = Map.Get(ref) + pc := reflect.New(reflect.TypeOf(obj).Elem()) + obj = pc.Interface().(mo.Reference) + s.Registry.setReference(obj, ref) + return s.Put(obj) } } diff --git a/vendor/github.com/vmware/govmomi/simulator/simulator.go b/vendor/github.com/vmware/govmomi/simulator/simulator.go index c78e2109975..673031fc950 100644 --- a/vendor/github.com/vmware/govmomi/simulator/simulator.go +++ b/vendor/github.com/vmware/govmomi/simulator/simulator.go @@ -24,15 +24,12 @@ import ( "encoding/base64" "encoding/json" "encoding/pem" - "flag" "fmt" "io" "io/ioutil" "log" - "math/rand" "net" "net/http" - "net/http/httptest" "net/url" "os" "path" @@ -40,10 +37,12 @@ import ( "sort" "strconv" "strings" - "time" + + "github.com/google/uuid" "github.com/vmware/govmomi/find" "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/simulator/internal" "github.com/vmware/govmomi/vim25" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/soap" @@ -51,8 +50,16 @@ import ( "github.com/vmware/govmomi/vim25/xml" ) -// Trace when set to true, writes SOAP traffic to stderr -var Trace = false +var ( + // Trace when set to true, writes SOAP traffic to stderr + Trace = false + + // TraceFile is the output file when Trace = true + TraceFile = os.Stderr + + // DefaultLogin for authentication + DefaultLogin = url.UserPassword("user", "pass") +) // Method encapsulates a decoded SOAP client request type Method struct { @@ -67,17 +74,21 @@ type Service struct { client *vim25.Client sm *SessionManager sdk map[string]*Registry + funcs []handleFunc delay *DelayConfig readAll func(io.Reader) ([]byte, error) + Listen *url.URL TLS *tls.Config ServeMux *http.ServeMux + // RegisterEndpoints will initialize any endpoints added via RegisterEndpoint + RegisterEndpoints bool } // Server provides a simulator Service over HTTP type Server struct { - *httptest.Server + *internal.Server URL *url.URL Tunnel int @@ -119,18 +130,35 @@ func Fault(msg string, fault types.BaseMethodFault) *soap.Fault { return f } +func tracef(format string, v ...interface{}) { + if Trace { + log.Printf(format, v...) + } +} + func (s *Service) call(ctx *Context, method *Method) soap.HasFault { handler := ctx.Map.Get(method.This) session := ctx.Session + ctx.Caller = &method.This + + if ctx.Map.Handler != nil { + h, fault := ctx.Map.Handler(ctx, method) + if fault != nil { + return &serverFaultBody{Reason: Fault("", fault)} + } + if h != nil { + handler = h + } + } if session == nil { switch method.Name { - case "RetrieveServiceContent", "PbmRetrieveServiceContent", "List", "Login", "LoginByToken", "LoginExtensionByCertificate", "RetrieveProperties", "RetrievePropertiesEx", "CloneSession": + case "RetrieveServiceContent", "PbmRetrieveServiceContent", "Fetch", "List", "Login", "LoginByToken", "LoginExtensionByCertificate", "RetrieveProperties", "RetrievePropertiesEx", "CloneSession": // ok for now, TODO: authz default: fault := &types.NotAuthenticated{ NoPermission: types.NoPermission{ - Object: method.This, + Object: &method.This, PrivilegeId: "System.View", }, } @@ -177,22 +205,8 @@ func (s *Service) call(ctx *Context, method *Method) soap.HasFault { } // We have a valid call. Introduce a delay if requested - // if s.delay != nil { - d := 0 - if s.delay.Delay > 0 { - d = s.delay.Delay - } - if md, ok := s.delay.MethodDelay[method.Name]; ok { - d += md - } - if s.delay.DelayJitter > 0 { - d += int(rand.NormFloat64() * s.delay.DelayJitter * float64(d)) - } - if d > 0 { - //fmt.Printf("Delaying method %s %d ms\n", name, d) - time.Sleep(time.Duration(d) * time.Millisecond) - } + s.delay.delay(method.Name) } var args, res []reflect.Value @@ -200,13 +214,21 @@ func (s *Service) call(ctx *Context, method *Method) soap.HasFault { args = append(args, reflect.ValueOf(ctx)) } args = append(args, reflect.ValueOf(method.Body)) - ctx.Map.WithLock(handler, func() { + ctx.Map.WithLock(ctx, handler, func() { res = m.Call(args) }) return res[0].Interface().(soap.HasFault) } +// internalSession is the session for use by the in-memory client (Service.RoundTrip) +var internalSession = &Session{ + UserSession: types.UserSession{ + Key: uuid.New().String(), + }, + Registry: NewRegistry(), +} + // RoundTrip implements the soap.RoundTripper interface in process. // Rather than encode/decode SOAP over HTTP, this implementation uses reflection. func (s *Service) RoundTrip(ctx context.Context, request, response soap.HasFault) error { @@ -229,7 +251,7 @@ func (s *Service) RoundTrip(ctx context.Context, request, response soap.HasFault res := s.call(&Context{ Map: Map, Context: ctx, - Session: internalContext.Session, + Session: internalSession, }, method) if err := res.Fault(); err != nil { @@ -283,6 +305,36 @@ func (d *faultDetail) MarshalXML(e *xml.Encoder, start xml.StartElement) error { return e.EncodeElement(d.Fault, start) } +// response sets xml.Name.Space when encoding Body. +// Note that namespace is intentionally omitted in the vim25/methods/methods.go Body.Res field tags. +type response struct { + Namespace string + Body soap.HasFault +} + +func (r *response) MarshalXML(e *xml.Encoder, start xml.StartElement) error { + val := reflect.ValueOf(r.Body).Elem().FieldByName("Res") + if !val.IsValid() { + return fmt.Errorf("%T: invalid response type (missing 'Res' field)", r.Body) + } + if val.IsNil() { + return fmt.Errorf("%T: invalid response (nil 'Res' field)", r.Body) + } + res := xml.StartElement{ + Name: xml.Name{ + Space: "urn:" + r.Namespace, + Local: val.Elem().Type().Name(), + }, + } + if err := e.EncodeToken(start); err != nil { + return err + } + if err := e.EncodeElement(val.Interface(), res); err != nil { + return err + } + return e.EncodeToken(start.End()) +} + // About generates some info about the simulator. func (s *Service) About(w http.ResponseWriter, r *http.Request) { var about struct { @@ -294,32 +346,34 @@ func (s *Service) About(w http.ResponseWriter, r *http.Request) { f := reflect.TypeOf((*soap.HasFault)(nil)).Elem() - for _, obj := range Map.objects { - kind := obj.Reference().Type - if seen[kind] { - continue - } - seen[kind] = true - - about.Types = append(about.Types, kind) - - t := reflect.TypeOf(obj) - for i := 0; i < t.NumMethod(); i++ { - m := t.Method(i) - if seen[m.Name] { + for _, sdk := range s.sdk { + for _, obj := range sdk.objects { + kind := obj.Reference().Type + if seen[kind] { continue } - seen[m.Name] = true + seen[kind] = true - in := m.Type.NumIn() - if in < 2 || in > 3 { // at least 2 params (receiver and request), optionally a 3rd param (context) - continue - } - if m.Type.NumOut() != 1 || m.Type.Out(0) != f { // all methods return soap.HasFault - continue - } + about.Types = append(about.Types, kind) - about.Methods = append(about.Methods, strings.Replace(m.Name, "Task", "_Task", 1)) + t := reflect.TypeOf(obj) + for i := 0; i < t.NumMethod(); i++ { + m := t.Method(i) + if seen[m.Name] { + continue + } + seen[m.Name] = true + + in := m.Type.NumIn() + if in < 2 || in > 3 { // at least 2 params (receiver and request), optionally a 3rd param (context) + continue + } + if m.Type.NumOut() != 1 || m.Type.Out(0) != f { // all methods return soap.HasFault + continue + } + + about.Methods = append(about.Methods, strings.Replace(m.Name, "Task", "_Task", 1)) + } } } @@ -332,6 +386,14 @@ func (s *Service) About(w http.ResponseWriter, r *http.Request) { _ = enc.Encode(&about) } +var endpoints []func(*Service, *Registry) + +// RegisterEndpoint funcs are called after the Server is initialized if Service.RegisterEndpoints=true. +// Such a func would typically register a SOAP endpoint via Service.RegisterSDK or REST endpoint via Service.Handle +func RegisterEndpoint(endpoint func(*Service, *Registry)) { + endpoints = append(endpoints, endpoint) +} + // Handle registers the handler for the given pattern with Service.ServeMux. func (s *Service) Handle(pattern string, handler http.Handler) { s.ServeMux.Handle(pattern, handler) @@ -342,8 +404,31 @@ func (s *Service) Handle(pattern string, handler http.Handler) { } } +type muxHandleFunc interface { + HandleFunc(string, func(http.ResponseWriter, *http.Request)) +} + +type handleFunc struct { + pattern string + handler func(http.ResponseWriter, *http.Request) +} + +// HandleFunc dispatches to http.ServeMux.HandleFunc after all endpoints have been registered. +// This allows dispatching to an endpoint's HandleFunc impl, such as vapi/simulator for example. +func (s *Service) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) { + s.funcs = append(s.funcs, handleFunc{pattern, handler}) +} + // RegisterSDK adds an HTTP handler for the Registry's Path and Namespace. +// If r.Path is already registered, r's objects are added to the existing Registry. func (s *Service) RegisterSDK(r *Registry) { + if existing, ok := s.sdk[r.Path]; ok { + for id, obj := range r.objects { + existing.objects[id] = obj + } + return + } + if s.ServeMux == nil { s.ServeMux = http.NewServeMux() } @@ -352,13 +437,24 @@ func (s *Service) RegisterSDK(r *Registry) { s.ServeMux.HandleFunc(r.Path, s.ServeSDK) } +// StatusSDK can be used to simulate an /sdk HTTP response code other than 200. +// The value of StatusSDK is restored to http.StatusOK after 1 response. +// This can be useful to test vim25.Retry() for example. +var StatusSDK = http.StatusOK + // ServeSDK implements the http.Handler interface func (s *Service) ServeSDK(w http.ResponseWriter, r *http.Request) { - if r.Method != "POST" { + if r.Method != http.MethodPost { w.WriteHeader(http.StatusMethodNotAllowed) return } + if StatusSDK != http.StatusOK { + w.WriteHeader(StatusSDK) + StatusSDK = http.StatusOK // reset + return + } + body, err := s.readAll(r.Body) _ = r.Body.Close() if err != nil { @@ -368,7 +464,7 @@ func (s *Service) ServeSDK(w http.ResponseWriter, r *http.Request) { } if Trace { - fmt.Fprintf(os.Stderr, "Request: %s\n", string(body)) + fmt.Fprintf(TraceFile, "Request: %s\n", string(body)) } ctx := &Context{ @@ -379,7 +475,7 @@ func (s *Service) ServeSDK(w http.ResponseWriter, r *http.Request) { Map: s.sdk[r.URL.Path], Context: context.Background(), } - ctx.Map.WithLock(s.sm, ctx.mapSession) + ctx.Map.WithLock(ctx, s.sm, ctx.mapSession) var res soap.HasFault var soapBody interface{} @@ -389,6 +485,10 @@ func (s *Service) ServeSDK(w http.ResponseWriter, r *http.Request) { res = serverFault(err.Error()) } else { ctx.Header = method.Header + if method.Name == "Fetch" { + // Redirect any Fetch method calls to the PropertyCollector singleton + method.This = ctx.Map.content().PropertyCollector + } res = s.call(ctx, method) } @@ -411,7 +511,7 @@ func (s *Service) ServeSDK(w http.ResponseWriter, r *http.Request) { } else { w.WriteHeader(http.StatusOK) - soapBody = res + soapBody = &response{ctx.Map.Namespace, res} } var out bytes.Buffer @@ -435,7 +535,7 @@ func (s *Service) ServeSDK(w http.ResponseWriter, r *http.Request) { } if Trace { - fmt.Fprintf(os.Stderr, "Response: %s\n", out.String()) + fmt.Fprintf(TraceFile, "Response: %s\n", out.String()) } _, _ = w.Write(out.Bytes()) @@ -475,7 +575,7 @@ func (s *Service) ServeDatastore(w http.ResponseWriter, r *http.Request) { p := path.Join(ds.Info.GetDatastoreInfo().Url, r.URL.Path) switch r.Method { - case "POST": + case http.MethodPost: _, err := os.Stat(p) if err == nil { // File exists @@ -485,7 +585,7 @@ func (s *Service) ServeDatastore(w http.ResponseWriter, r *http.Request) { // File does not exist, fallthrough to create via PUT logic fallthrough - case "PUT": + case http.MethodPut: dir := path.Dir(p) _ = os.MkdirAll(dir, 0700) @@ -506,13 +606,11 @@ func (s *Service) ServeDatastore(w http.ResponseWriter, r *http.Request) { } // ServiceVersions handler for the /sdk/vimServiceVersions.xml path. -func (*Service) ServiceVersions(w http.ResponseWriter, r *http.Request) { - // pyvmomi depends on this - +func (s *Service) ServiceVersions(w http.ResponseWriter, r *http.Request) { const versions = xml.Header + ` urn:vim25 - 6.5 + %s 6.0 5.5 @@ -520,7 +618,7 @@ func (*Service) ServiceVersions(w http.ResponseWriter, r *http.Request) { ` - fmt.Fprint(w, versions) + fmt.Fprintf(w, versions, s.client.ServiceContent.About.ApiVersion) } // defaultIP returns addr.IP if specified, otherwise attempts to find a non-loopback ipv4 IP @@ -559,14 +657,19 @@ func (s *Service) NewServer() *Server { s.RegisterSDK(Map) mux := s.ServeMux + vim := Map.Path + "/vimService" + s.sdk[vim] = s.sdk[vim25.Path] + mux.HandleFunc(vim, s.ServeSDK) mux.HandleFunc(Map.Path+"/vimServiceVersions.xml", s.ServiceVersions) mux.HandleFunc(folderPrefix, s.ServeDatastore) + mux.HandleFunc(guestPrefix, ServeGuest) + mux.HandleFunc(nfcPrefix, ServeNFC) mux.HandleFunc("/about", s.About) - // Using NewUnstartedServer() instead of NewServer(), - // for use in main.go, where Start() blocks, we can still set ServiceHostName - ts := httptest.NewUnstartedServer(mux) - + if s.Listen == nil { + s.Listen = new(url.URL) + } + ts := internal.NewUnstartedServer(mux, s.Listen.Host) addr := ts.Listener.Addr().(*net.TCPAddr) port := strconv.Itoa(addr.Port) u := &url.URL{ @@ -574,41 +677,68 @@ func (s *Service) NewServer() *Server { Host: net.JoinHostPort(defaultIP(addr), port), Path: Map.Path, } + if s.TLS != nil { + u.Scheme += "s" + } // Redirect clients to this http server, rather than HostSystem.Name Map.SessionManager().ServiceHostName = u.Host - if f := flag.Lookup("httptest.serve"); f != nil { - // Avoid the blocking behaviour of httptest.Server.Start() when this flag is set - _ = f.Value.Set("") - } - - cert := "" - if s.TLS == nil { - ts.Start() - } else { - ts.TLS = s.TLS - ts.TLS.ClientAuth = tls.RequestClientCert // Used by SessionManager.LoginExtensionByCertificate - ts.StartTLS() - u.Scheme += "s" - - cert = base64.StdEncoding.EncodeToString(ts.TLS.Certificates[0].Certificate[0]) - } - // Add vcsim config to OptionManager for use by SDK handlers (see lookup/simulator for example) m := Map.OptionManager() + for i := range m.Setting { + setting := m.Setting[i].GetOptionValue() + + if strings.HasSuffix(setting.Key, ".uri") { + // Rewrite any URIs with vcsim's host:port + endpoint, err := url.Parse(setting.Value.(string)) + if err == nil { + endpoint.Scheme = u.Scheme + endpoint.Host = u.Host + setting.Value = endpoint.String() + } + } + } m.Setting = append(m.Setting, &types.OptionValue{ Key: "vcsim.server.url", Value: u.String(), }, - &types.OptionValue{ - Key: "vcsim.server.cert", - Value: cert, - }, ) - u.User = url.UserPassword("user", "pass") + u.User = s.Listen.User + if u.User == nil { + u.User = DefaultLogin + } + s.Listen = u + + if s.RegisterEndpoints { + for i := range endpoints { + endpoints[i](s, Map) + } + } + + for _, f := range s.funcs { + pattern := &url.URL{Path: f.pattern} + endpoint, _ := s.ServeMux.Handler(&http.Request{URL: pattern}) + + if mux, ok := endpoint.(muxHandleFunc); ok { + mux.HandleFunc(f.pattern, f.handler) // e.g. vapi/simulator + } else { + s.ServeMux.HandleFunc(f.pattern, f.handler) + } + } + + if s.TLS != nil { + ts.TLS = s.TLS + ts.TLS.ClientAuth = tls.RequestClientCert // Used by SessionManager.LoginExtensionByCertificate + Map.SessionManager().TLSCert = func() string { + return base64.StdEncoding.EncodeToString(ts.TLS.Certificates[0].Certificate[0]) + } + ts.StartTLS() + } else { + ts.Start() + } return &Server{ Server: ts, diff --git a/vendor/github.com/vmware/govmomi/simulator/snapshot.go b/vendor/github.com/vmware/govmomi/simulator/snapshot.go index 0001e2894ce..bb1b66f6ffe 100644 --- a/vendor/github.com/vmware/govmomi/simulator/snapshot.go +++ b/vendor/github.com/vmware/govmomi/simulator/snapshot.go @@ -74,7 +74,7 @@ func (v *VirtualMachineSnapshot) createSnapshotFiles() types.BaseMethodFault { func (v *VirtualMachineSnapshot) removeSnapshotFiles(ctx *Context) types.BaseMethodFault { // TODO: also remove delta disks that were created when snapshot was taken - vm := Map.Get(v.Vm).(*VirtualMachine) + vm := ctx.Map.Get(v.Vm).(*VirtualMachine) for idx, sLayout := range vm.Layout.Snapshot { if sLayout.Key == v.Self { @@ -92,8 +92,8 @@ func (v *VirtualMachineSnapshot) removeSnapshotFiles(ctx *Context) types.BaseMet return fault } - host := Map.Get(*vm.Runtime.Host).(*HostSystem) - datastore := Map.FindByName(p.Datastore, host.Datastore).(*Datastore) + host := ctx.Map.Get(*vm.Runtime.Host).(*HostSystem) + datastore := ctx.Map.FindByName(p.Datastore, host.Datastore).(*Datastore) dFilePath := path.Join(datastore.Info.GetDatastoreInfo().Url, p.Path) _ = os.Remove(dFilePath) @@ -113,8 +113,8 @@ func (v *VirtualMachineSnapshot) RemoveSnapshotTask(ctx *Context, req *types.Rem task := CreateTask(v, "removeSnapshot", func(t *Task) (types.AnyType, types.BaseMethodFault) { var changes []types.PropertyChange - vm := Map.Get(v.Vm).(*VirtualMachine) - Map.WithLock(vm, func() { + vm := ctx.Map.Get(v.Vm).(*VirtualMachine) + ctx.WithLock(vm, func() { if vm.Snapshot.CurrentSnapshot != nil && *vm.Snapshot.CurrentSnapshot == req.This { parent := findParentSnapshotInTree(vm.Snapshot.RootSnapshotList, req.This) changes = append(changes, types.PropertyChange{Name: "snapshot.currentSnapshot", Val: parent}) @@ -123,35 +123,42 @@ func (v *VirtualMachineSnapshot) RemoveSnapshotTask(ctx *Context, req *types.Rem rootSnapshots := removeSnapshotInTree(vm.Snapshot.RootSnapshotList, req.This, req.RemoveChildren) changes = append(changes, types.PropertyChange{Name: "snapshot.rootSnapshotList", Val: rootSnapshots}) + rootSnapshotRefs := make([]types.ManagedObjectReference, len(rootSnapshots)) + for i, rs := range rootSnapshots { + rootSnapshotRefs[i] = rs.Snapshot + } + changes = append(changes, types.PropertyChange{Name: "rootSnapshot", Val: rootSnapshotRefs}) + if len(rootSnapshots) == 0 { changes = []types.PropertyChange{ {Name: "snapshot", Val: nil}, + {Name: "rootSnapshot", Val: nil}, } } - Map.Get(req.This).(*VirtualMachineSnapshot).removeSnapshotFiles(ctx) + ctx.Map.Get(req.This).(*VirtualMachineSnapshot).removeSnapshotFiles(ctx) - Map.Update(vm, changes) + ctx.Map.Update(vm, changes) }) - Map.Remove(req.This) + ctx.Map.Remove(ctx, req.This) return nil, nil }) return &methods.RemoveSnapshot_TaskBody{ Res: &types.RemoveSnapshot_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (v *VirtualMachineSnapshot) RevertToSnapshotTask(req *types.RevertToSnapshot_Task) soap.HasFault { - task := CreateTask(v, "revertToSnapshot", func(t *Task) (types.AnyType, types.BaseMethodFault) { - vm := Map.Get(v.Vm).(*VirtualMachine) +func (v *VirtualMachineSnapshot) RevertToSnapshotTask(ctx *Context, req *types.RevertToSnapshot_Task) soap.HasFault { + task := CreateTask(v.Vm, "revertToSnapshot", func(t *Task) (types.AnyType, types.BaseMethodFault) { + vm := ctx.Map.Get(v.Vm).(*VirtualMachine) - Map.WithLock(vm, func() { - Map.Update(vm, []types.PropertyChange{ + ctx.WithLock(vm, func() { + ctx.Map.Update(vm, []types.PropertyChange{ {Name: "snapshot.currentSnapshot", Val: v.Self}, }) }) @@ -161,7 +168,7 @@ func (v *VirtualMachineSnapshot) RevertToSnapshotTask(req *types.RevertToSnapsho return &methods.RevertToSnapshot_TaskBody{ Res: &types.RevertToSnapshot_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } diff --git a/vendor/github.com/vmware/govmomi/simulator/storage_resource_manager.go b/vendor/github.com/vmware/govmomi/simulator/storage_resource_manager.go index 248fb77458f..d169d6d079b 100644 --- a/vendor/github.com/vmware/govmomi/simulator/storage_resource_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/storage_resource_manager.go @@ -31,14 +31,7 @@ type StorageResourceManager struct { mo.StorageResourceManager } -func NewStorageResourceManager(ref types.ManagedObjectReference) object.Reference { - m := &StorageResourceManager{} - m.Self = ref - - return m -} - -func (m *StorageResourceManager) ConfigureStorageDrsForPodTask(req *types.ConfigureStorageDrsForPod_Task) soap.HasFault { +func (m *StorageResourceManager) ConfigureStorageDrsForPodTask(ctx *Context, req *types.ConfigureStorageDrsForPod_Task) soap.HasFault { task := CreateTask(m, "configureStorageDrsForPod", func(*Task) (types.AnyType, types.BaseMethodFault) { cluster := Map.Get(req.Pod).(*StoragePod) @@ -58,7 +51,7 @@ func (m *StorageResourceManager) ConfigureStorageDrsForPodTask(req *types.Config return &methods.ConfigureStorageDrsForPod_TaskBody{ Res: &types.ConfigureStorageDrsForPod_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } diff --git a/vendor/github.com/vmware/govmomi/simulator/task.go b/vendor/github.com/vmware/govmomi/simulator/task.go index 3b5939c55be..bd43f7420b9 100644 --- a/vendor/github.com/vmware/govmomi/simulator/task.go +++ b/vendor/github.com/vmware/govmomi/simulator/task.go @@ -29,9 +29,16 @@ import ( const vTaskSuffix = "_Task" // vmomi suffix const sTaskSuffix = "Task" // simulator suffix (avoiding golint warning) +// TaskDelay applies to all tasks. +// Names for DelayConfig.MethodDelay will differ for task and api delays. API +// level names often look like PowerOff_Task, whereas the task name is simply +// PowerOff. +var TaskDelay = DelayConfig{} + type Task struct { mo.Task + ctx *Context Execute func(*Task) (types.AnyType, types.BaseMethodFault) } @@ -77,33 +84,89 @@ type TaskRunner interface { Run(*Task) (types.AnyType, types.BaseMethodFault) } -func (t *Task) Run() types.ManagedObjectReference { - now := time.Now() +// taskReference is a helper struct so we can call AcquireLock in Run() +type taskReference struct { + Self types.ManagedObjectReference +} - Map.Update(t, []types.PropertyChange{ - {Name: "info.startTime", Val: now}, +func (tr *taskReference) Reference() types.ManagedObjectReference { + return tr.Self +} + +func (t *Task) Run(ctx *Context) types.ManagedObjectReference { + t.ctx = ctx + // alias the global Map to reduce data races in tests that reset the + // global Map variable. + vimMap := Map + + vimMap.AtomicUpdate(t.ctx, t, []types.PropertyChange{ + {Name: "info.startTime", Val: time.Now()}, {Name: "info.state", Val: types.TaskInfoStateRunning}, }) - res, err := t.Execute(t) - state := types.TaskInfoStateSuccess - var fault interface{} - if err != nil { - state = types.TaskInfoStateError - fault = types.LocalizedMethodFault{ - Fault: err, - LocalizedMessage: fmt.Sprintf("%T", err), - } + tr := &taskReference{ + Self: *t.Info.Entity, } - now = time.Now() + // in most cases, the caller already holds this lock, and we would like + // the lock to be held across the "hand off" to the async goroutine. + unlock := vimMap.AcquireLock(ctx, tr) - Map.Update(t, []types.PropertyChange{ - {Name: "info.completeTime", Val: now}, - {Name: "info.state", Val: state}, - {Name: "info.result", Val: res}, - {Name: "info.error", Val: fault}, - }) + go func() { + TaskDelay.delay(t.Info.Name) + res, err := t.Execute(t) + unlock() + + state := types.TaskInfoStateSuccess + var fault interface{} + if err != nil { + state = types.TaskInfoStateError + fault = types.LocalizedMethodFault{ + Fault: err, + LocalizedMessage: fmt.Sprintf("%T", err), + } + } + + vimMap.AtomicUpdate(t.ctx, t, []types.PropertyChange{ + {Name: "info.completeTime", Val: time.Now()}, + {Name: "info.state", Val: state}, + {Name: "info.result", Val: res}, + {Name: "info.error", Val: fault}, + }) + }() return t.Self } + +// RunBlocking() should only be used when an async simulator task needs to wait +// on another async simulator task. +// It polls for task completion to avoid the need to set up a PropertyCollector. +func (t *Task) RunBlocking(ctx *Context) { + _ = t.Run(ctx) + t.Wait() +} + +// Wait blocks until the task is complete. +func (t *Task) Wait() { + // we do NOT want to share our lock with the tasks's context, because + // the goroutine that executes the task will use ctx to update the + // state (among other things). + isolatedLockingContext := &Context{} + + isRunning := func() bool { + var running bool + Map.WithLock(isolatedLockingContext, t, func() { + switch t.Info.State { + case types.TaskInfoStateSuccess, types.TaskInfoStateError: + running = false + default: + running = true + } + }) + return running + } + + for isRunning() { + time.Sleep(10 * time.Millisecond) + } +} diff --git a/vendor/github.com/vmware/govmomi/simulator/task_manager.go b/vendor/github.com/vmware/govmomi/simulator/task_manager.go index af6f839d711..ae84635ea8f 100644 --- a/vendor/github.com/vmware/govmomi/simulator/task_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/task_manager.go @@ -19,7 +19,6 @@ package simulator import ( "sync" - "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/simulator/esx" "github.com/vmware/govmomi/simulator/vpx" "github.com/vmware/govmomi/vim25/mo" @@ -33,16 +32,15 @@ type TaskManager struct { sync.Mutex } -func NewTaskManager(ref types.ManagedObjectReference) object.Reference { - s := &TaskManager{} - s.Self = ref - if Map.IsESX() { - s.Description = esx.Description - } else { - s.Description = vpx.Description +func (m *TaskManager) init(r *Registry) { + if len(m.Description.MethodInfo) == 0 { + if r.IsVPX() { + m.Description = vpx.Description + } else { + m.Description = esx.Description + } } - Map.AddHandler(s) - return s + r.AddHandler(m) } func (m *TaskManager) PutObject(obj mo.Reference) { @@ -61,6 +59,6 @@ func (m *TaskManager) PutObject(obj mo.Reference) { m.Unlock() } -func (*TaskManager) RemoveObject(types.ManagedObjectReference) {} +func (*TaskManager) RemoveObject(*Context, types.ManagedObjectReference) {} func (*TaskManager) UpdateObject(mo.Reference, []types.PropertyChange) {} diff --git a/vendor/github.com/vmware/govmomi/simulator/tenant_manager.go b/vendor/github.com/vmware/govmomi/simulator/tenant_manager.go new file mode 100644 index 00000000000..51f06d6195d --- /dev/null +++ b/vendor/github.com/vmware/govmomi/simulator/tenant_manager.go @@ -0,0 +1,79 @@ +/* +Copyright (c) 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 simulator + +import ( + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type TenantManager struct { + mo.TenantTenantManager + + spEntities map[types.ManagedObjectReference]bool +} + +func (t *TenantManager) init(r *Registry) { + t.spEntities = make(map[types.ManagedObjectReference]bool) +} + +func (t *TenantManager) markEntities(entities []types.ManagedObjectReference) { + for _, e := range entities { + t.spEntities[e] = true + } +} + +func (t *TenantManager) unmarkEntities(entities []types.ManagedObjectReference) { + for _, e := range entities { + _, ok := t.spEntities[e] + if ok { + delete(t.spEntities, e) + } + } +} + +func (t *TenantManager) getEntities() []types.ManagedObjectReference { + entities := []types.ManagedObjectReference{} + for e := range t.spEntities { + entities = append(entities, e) + } + return entities +} + +func (t *TenantManager) MarkServiceProviderEntities(req *types.MarkServiceProviderEntities) soap.HasFault { + body := new(methods.MarkServiceProviderEntitiesBody) + t.markEntities(req.Entity) + body.Res = &types.MarkServiceProviderEntitiesResponse{} + return body +} + +func (t *TenantManager) UnmarkServiceProviderEntities(req *types.UnmarkServiceProviderEntities) soap.HasFault { + body := new(methods.UnmarkServiceProviderEntitiesBody) + t.unmarkEntities(req.Entity) + body.Res = &types.UnmarkServiceProviderEntitiesResponse{} + return body +} + +func (t *TenantManager) RetrieveServiceProviderEntities(req *types.RetrieveServiceProviderEntities) soap.HasFault { + body := new(methods.RetrieveServiceProviderEntitiesBody) + body.Res = &types.RetrieveServiceProviderEntitiesResponse{ + Returnval: t.getEntities(), + } + return body +} diff --git a/vendor/github.com/vmware/govmomi/simulator/user_directory.go b/vendor/github.com/vmware/govmomi/simulator/user_directory.go index 6c474f9016e..929409b0fae 100644 --- a/vendor/github.com/vmware/govmomi/simulator/user_directory.go +++ b/vendor/github.com/vmware/govmomi/simulator/user_directory.go @@ -19,7 +19,6 @@ package simulator import ( "strings" - "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/soap" @@ -38,13 +37,8 @@ type UserDirectory struct { userGroup []*types.UserSearchResult } -func NewUserDirectory(ref types.ManagedObjectReference) object.Reference { - u := &UserDirectory{} - - u.Self = ref - u.userGroup = DefaultUserGroup - - return u +func (m *UserDirectory) init(*Registry) { + m.userGroup = DefaultUserGroup } func (u *UserDirectory) RetrieveUserGroups(req *types.RetrieveUserGroups) soap.HasFault { diff --git a/vendor/github.com/vmware/govmomi/simulator/view_manager.go b/vendor/github.com/vmware/govmomi/simulator/view_manager.go index 133d9ff5655..62d91bcc479 100644 --- a/vendor/github.com/vmware/govmomi/simulator/view_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/view_manager.go @@ -19,7 +19,6 @@ package simulator import ( "reflect" - "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/soap" @@ -54,25 +53,14 @@ var entities = []struct { {reflect.TypeOf((*mo.VmwareDistributedVirtualSwitch)(nil)).Elem(), false}, } -func NewViewManager(ref types.ManagedObjectReference) object.Reference { - s := &ViewManager{ - entities: make(map[string]bool), - } - - s.Self = ref - +func (m *ViewManager) init(*Registry) { + m.entities = make(map[string]bool, len(entities)) for _, e := range entities { - s.entities[e.Type.Name()] = e.Container + m.entities[e.Type.Name()] = e.Container } - - return s } func destroyView(ref types.ManagedObjectReference) soap.HasFault { - m := Map.ViewManager() - - RemoveReference(&m.ViewList, ref) - return &methods.DestroyViewBody{ Res: &types.DestroyViewResponse{}, } @@ -81,13 +69,13 @@ func destroyView(ref types.ManagedObjectReference) soap.HasFault { func (m *ViewManager) CreateContainerView(ctx *Context, req *types.CreateContainerView) soap.HasFault { body := &methods.CreateContainerViewBody{} - root := Map.Get(req.Container) + root := ctx.Map.Get(req.Container) if root == nil { body.Fault_ = Fault("", &types.ManagedObjectNotFound{Obj: req.Container}) return body } - if m.entities[root.Reference().Type] != true { + if !m.entities[root.Reference().Type] { body.Fault_ = Fault("", &types.InvalidArgument{InvalidProperty: "container"}) return body } @@ -98,6 +86,7 @@ func (m *ViewManager) CreateContainerView(ctx *Context, req *types.CreateContain Recursive: req.Recursive, Type: req.Type, }, + root, make(map[string]bool), } @@ -117,9 +106,7 @@ func (m *ViewManager) CreateContainerView(ctx *Context, req *types.CreateContain } } - ctx.Session.Put(container) - - m.ViewList = append(m.ViewList, container.Reference()) + ctx.Session.setReference(container) body.Res = &types.CreateContainerViewResponse{ Returnval: container.Self, @@ -128,17 +115,22 @@ func (m *ViewManager) CreateContainerView(ctx *Context, req *types.CreateContain seen := make(map[types.ManagedObjectReference]bool) container.add(root, seen) + ctx.Session.Registry.Put(container) + ctx.Map.AddHandler(container) + return body } type ContainerView struct { mo.ContainerView + root mo.Reference types map[string]bool } func (v *ContainerView) DestroyView(ctx *Context, c *types.DestroyView) soap.HasFault { - ctx.Session.Remove(c.This) + ctx.Map.RemoveHandler(v) + ctx.Session.Remove(ctx, c.This) return destroyView(c.This) } @@ -151,26 +143,30 @@ func (v *ContainerView) include(o types.ManagedObjectReference) bool { } func walk(root mo.Reference, f func(child types.ManagedObjectReference)) { + if _, ok := root.(types.ManagedObjectReference); ok || root == nil { + return + } + var children []types.ManagedObjectReference - switch e := root.(type) { - case *Datacenter: + switch e := getManagedObject(root).Addr().Interface().(type) { + case *mo.Datacenter: children = []types.ManagedObjectReference{e.VmFolder, e.HostFolder, e.DatastoreFolder, e.NetworkFolder} - case *Folder: + case *mo.Folder: children = e.ChildEntity case *mo.ComputeResource: children = e.Host children = append(children, *e.ResourcePool) - case *ClusterComputeResource: + case *mo.ClusterComputeResource: children = e.Host children = append(children, *e.ResourcePool) - case *ResourcePool: + case *mo.ResourcePool: + children = e.ResourcePool + children = append(children, e.Vm...) + case *mo.VirtualApp: children = e.ResourcePool.ResourcePool children = append(children, e.Vm...) - case *VirtualApp: - children = e.ResourcePool.ResourcePool - children = append(children, e.Vm...) - case *HostSystem: + case *mo.HostSystem: children = e.Vm } @@ -182,7 +178,7 @@ func walk(root mo.Reference, f func(child types.ManagedObjectReference)) { func (v *ContainerView) add(root mo.Reference, seen map[types.ManagedObjectReference]bool) { walk(root, func(child types.ManagedObjectReference) { if v.include(child) { - if seen[child] == false { + if !seen[child] { seen[child] = true v.View = append(v.View, child) } @@ -194,6 +190,37 @@ func (v *ContainerView) add(root mo.Reference, seen map[types.ManagedObjectRefer }) } +func (v *ContainerView) find(root mo.Reference, ref types.ManagedObjectReference, found *bool) bool { + walk(root, func(child types.ManagedObjectReference) { + if *found { + return + } + if child == ref { + *found = true + return + } + if v.Recursive { + *found = v.find(Map.Get(child), ref, found) + } + }) + + return *found +} + +func (v *ContainerView) PutObject(obj mo.Reference) { + ref := obj.Reference() + + if v.include(ref) && v.find(v.root, ref, types.NewBool(false)) { + Map.Update(v, []types.PropertyChange{{Name: "view", Val: append(v.View, ref)}}) + } +} + +func (v *ContainerView) RemoveObject(ctx *Context, obj types.ManagedObjectReference) { + ctx.Map.RemoveReference(ctx, v, &v.View, obj) +} + +func (*ContainerView) UpdateObject(mo.Reference, []types.PropertyChange) {} + func (m *ViewManager) CreateListView(ctx *Context, req *types.CreateListView) soap.HasFault { body := new(methods.CreateListViewBody) list := new(ListView) @@ -232,7 +259,7 @@ func (v *ListView) add(refs []types.ManagedObjectReference) *types.ManagedObject } func (v *ListView) DestroyView(ctx *Context, c *types.DestroyView) soap.HasFault { - ctx.Session.Remove(c.This) + ctx.Session.Remove(ctx, c.This) return destroyView(c.This) } diff --git a/vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go b/vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go index 63364f5b9a3..88844b23732 100644 --- a/vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/virtual_disk_manager.go @@ -17,11 +17,12 @@ limitations under the License. package simulator import ( + "fmt" "os" "strings" "github.com/google/uuid" - "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/soap" @@ -32,20 +33,18 @@ type VirtualDiskManager struct { mo.VirtualDiskManager } -func NewVirtualDiskManager(ref types.ManagedObjectReference) object.Reference { - m := &VirtualDiskManager{} - m.Self = ref - return m +func (m *VirtualDiskManager) MO() mo.VirtualDiskManager { + return m.VirtualDiskManager } -func (m *VirtualDiskManager) names(name string) []string { +func vdmNames(name string) []string { return []string{ strings.Replace(name, ".vmdk", "-flat.vmdk", 1), name, } } -func (m *VirtualDiskManager) createVirtualDisk(op types.VirtualDeviceConfigSpecFileOperation, req *types.CreateVirtualDisk_Task) types.BaseMethodFault { +func vdmCreateVirtualDisk(op types.VirtualDeviceConfigSpecFileOperation, req *types.CreateVirtualDisk_Task) types.BaseMethodFault { fm := Map.FileManager() file, fault := fm.resolve(req.Datacenter, req.Name) @@ -55,7 +54,7 @@ func (m *VirtualDiskManager) createVirtualDisk(op types.VirtualDeviceConfigSpecF shouldReplace := op == types.VirtualDeviceConfigSpecFileOperationReplace shouldExist := op == "" - for _, name := range m.names(file) { + for _, name := range vdmNames(file) { _, err := os.Stat(name) if err == nil { if shouldExist { @@ -83,23 +82,26 @@ func (m *VirtualDiskManager) createVirtualDisk(op types.VirtualDeviceConfigSpecF return nil } -func (m *VirtualDiskManager) CreateVirtualDiskTask(req *types.CreateVirtualDisk_Task) soap.HasFault { +func (m *VirtualDiskManager) CreateVirtualDiskTask(ctx *Context, req *types.CreateVirtualDisk_Task) soap.HasFault { task := CreateTask(m, "createVirtualDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { - return nil, m.createVirtualDisk(types.VirtualDeviceConfigSpecFileOperationCreate, req) + if err := vdmCreateVirtualDisk(types.VirtualDeviceConfigSpecFileOperationCreate, req); err != nil { + return "", err + } + return req.Name, nil }) return &methods.CreateVirtualDisk_TaskBody{ Res: &types.CreateVirtualDisk_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (m *VirtualDiskManager) DeleteVirtualDiskTask(req *types.DeleteVirtualDisk_Task) soap.HasFault { +func (m *VirtualDiskManager) DeleteVirtualDiskTask(ctx *Context, req *types.DeleteVirtualDisk_Task) soap.HasFault { task := CreateTask(m, "deleteVirtualDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { fm := Map.FileManager() - for _, name := range m.names(req.Name) { + for _, name := range vdmNames(req.Name) { err := fm.deleteDatastoreFile(&types.DeleteDatastoreFile_Task{ Name: name, Datacenter: req.Datacenter, @@ -115,18 +117,18 @@ func (m *VirtualDiskManager) DeleteVirtualDiskTask(req *types.DeleteVirtualDisk_ return &methods.DeleteVirtualDisk_TaskBody{ Res: &types.DeleteVirtualDisk_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (m *VirtualDiskManager) MoveVirtualDiskTask(req *types.MoveVirtualDisk_Task) soap.HasFault { +func (m *VirtualDiskManager) MoveVirtualDiskTask(ctx *Context, req *types.MoveVirtualDisk_Task) soap.HasFault { task := CreateTask(m, "moveVirtualDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { - fm := Map.FileManager() + fm := ctx.Map.FileManager() - dest := m.names(req.DestName) + dest := vdmNames(req.DestName) - for i, name := range m.names(req.SourceName) { + for i, name := range vdmNames(req.SourceName) { err := fm.moveDatastoreFile(&types.MoveDatastoreFile_Task{ SourceName: name, SourceDatacenter: req.SourceDatacenter, @@ -145,24 +147,24 @@ func (m *VirtualDiskManager) MoveVirtualDiskTask(req *types.MoveVirtualDisk_Task return &methods.MoveVirtualDisk_TaskBody{ Res: &types.MoveVirtualDisk_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (m *VirtualDiskManager) CopyVirtualDiskTask(req *types.CopyVirtualDisk_Task) soap.HasFault { +func (m *VirtualDiskManager) CopyVirtualDiskTask(ctx *Context, req *types.CopyVirtualDisk_Task) soap.HasFault { task := CreateTask(m, "copyVirtualDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { if req.DestSpec != nil { - if Map.IsVPX() { + if ctx.Map.IsVPX() { return nil, new(types.NotImplemented) } } - fm := Map.FileManager() + fm := ctx.Map.FileManager() - dest := m.names(req.DestName) + dest := vdmNames(req.DestName) - for i, name := range m.names(req.SourceName) { + for i, name := range vdmNames(req.SourceName) { err := fm.copyDatastoreFile(&types.CopyDatastoreFile_Task{ SourceName: name, SourceDatacenter: req.SourceDatacenter, @@ -181,15 +183,22 @@ func (m *VirtualDiskManager) CopyVirtualDiskTask(req *types.CopyVirtualDisk_Task return &methods.CopyVirtualDisk_TaskBody{ Res: &types.CopyVirtualDisk_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (m *VirtualDiskManager) QueryVirtualDiskUuid(req *types.QueryVirtualDiskUuid) soap.HasFault { +func virtualDiskUUID(dc *types.ManagedObjectReference, file string) string { + if dc != nil { + file = dc.String() + file + } + return uuid.NewSHA1(uuid.NameSpaceOID, []byte(file)).String() +} + +func (m *VirtualDiskManager) QueryVirtualDiskUuid(ctx *Context, req *types.QueryVirtualDiskUuid) soap.HasFault { body := new(methods.QueryVirtualDiskUuidBody) - fm := Map.FileManager() + fm := ctx.Map.FileManager() file, fault := fm.resolve(req.Datacenter, req.Name) if fault != nil { @@ -199,19 +208,19 @@ func (m *VirtualDiskManager) QueryVirtualDiskUuid(req *types.QueryVirtualDiskUui _, err := os.Stat(file) if err != nil { - fault = fm.fault(file, err, new(types.CannotAccessFile)) - body.Fault_ = Fault("", fault) + fault = fm.fault(req.Name, err, new(types.CannotAccessFile)) + body.Fault_ = Fault(fmt.Sprintf("File %s was not found", req.Name), fault) return body } body.Res = &types.QueryVirtualDiskUuidResponse{ - Returnval: uuid.NewSHA1(uuid.NameSpaceOID, []byte(file)).String(), + Returnval: virtualDiskUUID(req.Datacenter, file), } return body } -func (m *VirtualDiskManager) SetVirtualDiskUuid(req *types.SetVirtualDiskUuid) soap.HasFault { +func (m *VirtualDiskManager) SetVirtualDiskUuid(_ *Context, req *types.SetVirtualDiskUuid) soap.HasFault { body := new(methods.SetVirtualDiskUuidBody) // TODO: validate uuid format and persist body.Res = new(types.SetVirtualDiskUuidResponse) diff --git a/vendor/github.com/vmware/govmomi/simulator/virtual_machine.go b/vendor/github.com/vmware/govmomi/simulator/virtual_machine.go index 47a0cd911cd..8deeceda7ac 100644 --- a/vendor/github.com/vmware/govmomi/simulator/virtual_machine.go +++ b/vendor/github.com/vmware/govmomi/simulator/virtual_machine.go @@ -25,12 +25,14 @@ import ( "os" "path" "path/filepath" + "reflect" "strconv" "strings" "sync/atomic" "time" "github.com/google/uuid" + "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/simulator/esx" "github.com/vmware/govmomi/vim25/methods" @@ -45,13 +47,21 @@ type VirtualMachine struct { log string sid int32 run container + uid uuid.UUID + imc *types.CustomizationSpec } -func NewVirtualMachine(parent types.ManagedObjectReference, spec *types.VirtualMachineConfigSpec) (*VirtualMachine, types.BaseMethodFault) { +func asVirtualMachineMO(obj mo.Reference) (*mo.VirtualMachine, bool) { + vm, ok := getManagedObject(obj).Addr().Interface().(*mo.VirtualMachine) + return vm, ok +} + +func NewVirtualMachine(ctx *Context, parent types.ManagedObjectReference, spec *types.VirtualMachineConfigSpec) (*VirtualMachine, types.BaseMethodFault) { vm := &VirtualMachine{} vm.Parent = &parent + ctx.Map.reference(vm) - Map.Get(parent).(*Folder).putChild(vm) + folder := ctx.Map.Get(parent) if spec.Name == "" { return vm, &types.InvalidVmConfig{Property: "configSpec.name"} @@ -64,10 +74,13 @@ func NewVirtualMachine(parent types.ManagedObjectReference, spec *types.VirtualM rspec := types.DefaultResourceConfigSpec() vm.Guest = &types.GuestInfo{} vm.Config = &types.VirtualMachineConfigInfo{ - ExtraConfig: []types.BaseOptionValue{&types.OptionValue{Key: "govcsim", Value: "TRUE"}}, - Tools: &types.ToolsConfigInfo{}, - MemoryAllocation: &rspec.MemoryAllocation, - CpuAllocation: &rspec.CpuAllocation, + ExtraConfig: []types.BaseOptionValue{&types.OptionValue{Key: "govcsim", Value: "TRUE"}}, + Tools: &types.ToolsConfigInfo{}, + MemoryAllocation: &rspec.MemoryAllocation, + CpuAllocation: &rspec.CpuAllocation, + LatencySensitivity: &types.LatencySensitivity{Level: types.LatencySensitivitySensitivityLevelNormal}, + BootOptions: &types.VirtualMachineBootOptions{}, + CreateDate: types.NewTime(time.Now()), } vm.Layout = &types.VirtualMachineFileLayout{} vm.LayoutEx = &types.VirtualMachineFileLayoutEx{ @@ -83,24 +96,51 @@ func NewVirtualMachine(parent types.ManagedObjectReference, spec *types.VirtualM Timestamp: time.Now(), } - // Append VM Name as the directory name if not specified - if strings.HasSuffix(spec.Files.VmPathName, "]") { // e.g. "[datastore1]" - spec.Files.VmPathName += " " + spec.Name + vmx := vm.vmx(spec) + if vmx.Path == "" { + // Append VM Name as the directory name if not specified + vmx.Path = spec.Name } - if !strings.HasSuffix(spec.Files.VmPathName, ".vmx") { - spec.Files.VmPathName = path.Join(spec.Files.VmPathName, spec.Name+".vmx") + dc := ctx.Map.getEntityDatacenter(folder.(mo.Entity)) + ds := ctx.Map.FindByName(vmx.Datastore, dc.Datastore).(*Datastore) + dir := path.Join(ds.Info.GetDatastoreInfo().Url, vmx.Path) + + if path.Ext(vmx.Path) == ".vmx" { + dir = path.Dir(dir) + // Ignore error here, deferring to createFile + _ = os.Mkdir(dir, 0700) + } else { + // Create VM directory, renaming if already exists + name := dir + + for i := 0; i < 1024; /* just in case */ i++ { + err := os.Mkdir(name, 0700) + if err != nil { + if os.IsExist(err) { + name = fmt.Sprintf("%s (%d)", dir, i) + continue + } + return nil, &types.FileFault{File: name} + } + break + } + vmx.Path = path.Join(path.Base(name), spec.Name+".vmx") } + spec.Files.VmPathName = vmx.String() + dsPath := path.Dir(spec.Files.VmPathName) + vm.uid = sha1UUID(spec.Files.VmPathName) defaults := types.VirtualMachineConfigSpec{ NumCPUs: 1, NumCoresPerSocket: 1, MemoryMB: 32, - Uuid: uuid.New().String(), - InstanceUuid: uuid.New().String(), + Uuid: vm.uid.String(), + InstanceUuid: newUUID(strings.ToUpper(spec.Files.VmPathName)), Version: esx.HardwareVersion, + Firmware: string(types.GuestOsDescriptorFirmwareTypeBios), Files: &types.VirtualMachineFileInfo{ SnapshotDirectory: dsPath, SuspendDirectory: dsPath, @@ -111,7 +151,7 @@ func NewVirtualMachine(parent types.ManagedObjectReference, spec *types.VirtualM // Add the default devices defaults.DeviceChange, _ = object.VirtualDeviceList(esx.VirtualDevice).ConfigSpec(types.VirtualDeviceConfigSpecOperationAdd) - err := vm.configure(&defaults) + err := vm.configure(ctx, &defaults) if err != nil { return vm, err } @@ -120,13 +160,27 @@ func NewVirtualMachine(parent types.ManagedObjectReference, spec *types.VirtualM vm.Runtime.ConnectionState = types.VirtualMachineConnectionStateConnected vm.Summary.Runtime = vm.Runtime + vm.Capability.ChangeTrackingSupported = types.NewBool(changeTrackingSupported(spec)) + vm.Summary.QuickStats.GuestHeartbeatStatus = types.ManagedEntityStatusGray vm.Summary.OverallStatus = types.ManagedEntityStatusGreen vm.ConfigStatus = types.ManagedEntityStatusGreen + // put vm in the folder only if no errors occurred + f, _ := asFolderMO(folder) + folderPutChild(ctx, f, vm) + return vm, nil } +func (o *VirtualMachine) RenameTask(ctx *Context, r *types.Rename_Task) soap.HasFault { + return RenameTask(ctx, o, r) +} + +func (*VirtualMachine) Reload(*types.Reload) soap.HasFault { + return &methods.ReloadBody{Res: new(types.ReloadResponse)} +} + func (vm *VirtualMachine) event() types.VmEvent { host := Map.Get(*vm.Runtime.Host).(*HostSystem) @@ -135,6 +189,7 @@ func (vm *VirtualMachine) event() types.VmEvent { Datacenter: datacenterEventArgument(host), ComputeResource: host.eventArgumentParent(), Host: host.eventArgument(), + Ds: Map.Get(vm.Datastore[0]).(*Datastore).eventArgument(), Vm: &types.VmEventArgument{ EntityEventArgument: types.EntityEventArgument{Name: vm.Name}, Vm: vm.Self, @@ -143,6 +198,10 @@ func (vm *VirtualMachine) event() types.VmEvent { } } +func (vm *VirtualMachine) hostInMM(ctx *Context) bool { + return ctx.Map.Get(*vm.Runtime.Host).(*HostSystem).Runtime.InMaintenanceMode +} + func (vm *VirtualMachine) apply(spec *types.VirtualMachineConfigSpec) { if spec.Files == nil { spec.Files = new(types.VirtualMachineFileInfo) @@ -268,10 +327,78 @@ func (vm *VirtualMachine) apply(spec *types.VirtualMachineConfigSpec) { vm.Config.Hardware.NumCoresPerSocket = spec.NumCoresPerSocket } + if spec.GuestId != "" { + vm.Guest.GuestFamily = guestFamily(spec.GuestId) + } + + vm.Config.Modified = time.Now() +} + +// updateVAppProperty updates the simulator VM with the specified VApp properties. +func (vm *VirtualMachine) updateVAppProperty(spec *types.VmConfigSpec) types.BaseMethodFault { + ps := make([]types.VAppPropertyInfo, 0) + + if vm.Config.VAppConfig != nil && vm.Config.VAppConfig.GetVmConfigInfo() != nil { + ps = vm.Config.VAppConfig.GetVmConfigInfo().Property + } + + for _, prop := range spec.Property { + var foundIndex int + exists := false + // Check if the specified property exists or not. This helps rejecting invalid + // operations (e.g., Adding a VApp property that already exists) + for i, p := range ps { + if p.Key == prop.Info.Key { + exists = true + foundIndex = i + break + } + } + + switch prop.Operation { + case types.ArrayUpdateOperationAdd: + if exists { + return new(types.InvalidArgument) + } + ps = append(ps, *prop.Info) + case types.ArrayUpdateOperationEdit: + if !exists { + return new(types.InvalidArgument) + } + ps[foundIndex] = *prop.Info + case types.ArrayUpdateOperationRemove: + if !exists { + return new(types.InvalidArgument) + } + ps = append(ps[:foundIndex], ps[foundIndex+1:]...) + } + } + + if vm.Config.VAppConfig == nil { + vm.Config.VAppConfig = &types.VmConfigInfo{} + } + + vm.Config.VAppConfig.GetVmConfigInfo().Property = ps + + return nil +} + +var extraConfigAlias = map[string]string{ + "ip0": "SET.guest.ipAddress", +} + +func extraConfigKey(key string) string { + if k, ok := extraConfigAlias[key]; ok { + return k + } + return key +} + +func (vm *VirtualMachine) applyExtraConfig(spec *types.VirtualMachineConfigSpec) { var changes []types.PropertyChange for _, c := range spec.ExtraConfig { val := c.GetOptionValue() - key := strings.TrimPrefix(val.Key, "SET.") + key := strings.TrimPrefix(extraConfigKey(val.Key), "SET.") if key == val.Key { vm.Config.ExtraConfig = append(vm.Config.ExtraConfig, c) continue @@ -280,12 +407,14 @@ func (vm *VirtualMachine) apply(spec *types.VirtualMachineConfigSpec) { switch key { case "guest.ipAddress": - ip := val.Value.(string) - vm.Guest.Net[0].IpAddress = []string{ip} - changes = append(changes, - types.PropertyChange{Name: "summary." + key, Val: ip}, - types.PropertyChange{Name: "guest.net", Val: vm.Guest.Net}, - ) + if len(vm.Guest.Net) > 0 { + ip := val.Value.(string) + vm.Guest.Net[0].IpAddress = []string{ip} + changes = append(changes, + types.PropertyChange{Name: "summary." + key, Val: ip}, + types.PropertyChange{Name: "guest.net", Val: vm.Guest.Net}, + ) + } case "guest.hostName": changes = append(changes, types.PropertyChange{Name: "summary." + key, Val: val.Value}, @@ -295,8 +424,6 @@ func (vm *VirtualMachine) apply(spec *types.VirtualMachineConfigSpec) { if len(changes) != 0 { Map.Update(vm, changes) } - - vm.Config.Modified = time.Now() } func validateGuestID(id string) types.BaseMethodFault { @@ -309,7 +436,7 @@ func validateGuestID(id string) types.BaseMethodFault { return &types.InvalidArgument{InvalidProperty: "configSpec.guestId"} } -func (vm *VirtualMachine) configure(spec *types.VirtualMachineConfigSpec) types.BaseMethodFault { +func (vm *VirtualMachine) configure(ctx *Context, spec *types.VirtualMachineConfigSpec) types.BaseMethodFault { vm.apply(spec) if spec.MemoryAllocation != nil { @@ -330,7 +457,19 @@ func (vm *VirtualMachine) configure(spec *types.VirtualMachineConfigSpec) types. } } - return vm.configureDevices(spec) + if o := spec.BootOptions; o != nil { + if isTrue(o.EfiSecureBootEnabled) && vm.Config.Firmware != string(types.GuestOsDescriptorFirmwareTypeEfi) { + return &types.InvalidVmConfig{Property: "msg.hostd.configSpec.efi"} + } + } + + if spec.VAppConfig != nil { + if err := vm.updateVAppProperty(spec.VAppConfig.GetVmConfigSpec()); err != nil { + return err + } + } + + return vm.configureDevices(ctx, spec) } func getVMFileType(fileName string) types.VirtualMachineFileLayoutExFileType { @@ -533,9 +672,8 @@ func (vm *VirtualMachine) updateDiskLayouts() types.BaseMethodFault { var fileKeys []int32 - dm := Map.VirtualDiskManager() // Add disk descriptor and extent files - for _, diskName := range dm.names(dFileName) { + for _, diskName := range vdmNames(dFileName) { // get full path including datastore location p, fault := parseDatastorePath(diskName) if fault != nil { @@ -702,7 +840,7 @@ func (vm *VirtualMachine) RefreshStorageInfo(ctx *Context, req *types.RefreshSto files, err := ioutil.ReadDir(directory) if err != nil { - body.Fault_ = soap.ToSoapFault(err) + body.Fault_ = Fault("", ctx.Map.FileManager().fault(directory, err, new(types.CannotAccessFile))) return body } @@ -724,14 +862,19 @@ func (vm *VirtualMachine) RefreshStorageInfo(ctx *Context, req *types.RefreshSto vm.LayoutEx.Timestamp = time.Now() + body.Res = new(types.RefreshStorageInfoResponse) + return body } -func (vm *VirtualMachine) useDatastore(name string) *Datastore { +func (vm *VirtualMachine) findDatastore(name string) *Datastore { host := Map.Get(*vm.Runtime.Host).(*HostSystem) - ds := Map.FindByName(name, host.Datastore).(*Datastore) + return Map.FindByName(name, host.Datastore).(*Datastore) +} +func (vm *VirtualMachine) useDatastore(name string) *Datastore { + ds := vm.findDatastore(name) if FindReference(vm.Datastore, ds.Self) == nil { vm.Datastore = append(vm.Datastore, ds.Self) } @@ -739,6 +882,16 @@ func (vm *VirtualMachine) useDatastore(name string) *Datastore { return ds } +func (vm *VirtualMachine) vmx(spec *types.VirtualMachineConfigSpec) object.DatastorePath { + var p object.DatastorePath + vmx := vm.Config.Files.VmPathName + if spec != nil { + vmx = spec.Files.VmPathName + } + p.FromString(vmx) + return p +} + func (vm *VirtualMachine) createFile(spec string, name string, register bool) (*os.File, types.BaseMethodFault) { p, fault := parseDatastorePath(spec) if fault != nil { @@ -747,6 +900,23 @@ func (vm *VirtualMachine) createFile(spec string, name string, register bool) (* ds := vm.useDatastore(p.Datastore) + nhost := len(ds.Host) + if ds.Name == "vsanDatastore" && nhost < 3 { + fault := new(types.CannotCreateFile) + fault.FaultMessage = []types.LocalizableMessage{ + { + Key: "vob.vsanprovider.object.creation.failed", + Message: "Failed to create object.", + }, + { + Key: "vob.vsan.clomd.needMoreFaultDomains2", + Message: fmt.Sprintf("There are currently %d usable fault domains. The operation requires %d more usable fault domains.", nhost, 3-nhost), + }, + } + fault.File = p.Path + return nil, fault + } + file := path.Join(ds.Info.GetDatastoreInfo().Url, p.Path) if name != "" { @@ -758,7 +928,7 @@ func (vm *VirtualMachine) createFile(spec string, name string, register bool) (* } if register { - f, err := os.Open(file) + f, err := os.Open(filepath.Clean(file)) if err != nil { log.Printf("register %s: %s", vm.Reference(), err) if os.IsNotExist(err) { @@ -771,21 +941,25 @@ func (vm *VirtualMachine) createFile(spec string, name string, register bool) (* return f, nil } - dir := path.Dir(file) - - _ = os.MkdirAll(dir, 0700) - _, err := os.Stat(file) if err == nil { - return nil, &types.FileAlreadyExists{ - FileFault: types.FileFault{ - File: file, - }, + fault := &types.FileAlreadyExists{FileFault: types.FileFault{File: file}} + log.Printf("%T: %s", fault, file) + return nil, fault + } + + // Create parent directory if needed + dir := path.Dir(file) + _, err = os.Stat(dir) + if err != nil { + if os.IsNotExist(err) { + _ = os.Mkdir(dir, 0700) } } f, err := os.Create(file) if err != nil { + log.Printf("create(%s): %s", file, err) return nil, &types.FileFault{ File: file, } @@ -806,7 +980,7 @@ func (vm *VirtualMachine) logPrintf(format string, v ...interface{}) { _ = f.Close() } -func (vm *VirtualMachine) create(spec *types.VirtualMachineConfigSpec, register bool) types.BaseMethodFault { +func (vm *VirtualMachine) create(ctx *Context, spec *types.VirtualMachineConfigSpec, register bool) types.BaseMethodFault { vm.apply(spec) if spec.Version != "" { @@ -841,7 +1015,7 @@ func (vm *VirtualMachine) create(spec *types.VirtualMachineConfigSpec, register vm.logPrintf("created") - return vm.configureDevices(spec) + return vm.configureDevices(ctx, spec) } var vmwOUI = net.HardwareAddr([]byte{0x0, 0xc, 0x29}) @@ -850,12 +1024,14 @@ var vmwOUI = net.HardwareAddr([]byte{0x0, 0xc, 0x29}) // "The host generates generateMAC addresses that consists of the VMware OUI 00:0C:29 and the last three octets in hexadecimal // format of the virtual machine UUID. The virtual machine UUID is based on a hash calculated by using the UUID of the // ESXi physical machine and the path to the configuration file (.vmx) of the virtual machine." -func (vm *VirtualMachine) generateMAC() string { - id := uuid.New() // Random is fine for now. +func (vm *VirtualMachine) generateMAC(unit int32) string { + id := []byte(vm.Config.Uuid) offset := len(id) - len(vmwOUI) + key := id[offset] + byte(unit) // add device unit number, giving each VM NIC a unique MAC + id = append([]byte{key}, id[offset+1:]...) - mac := append(vmwOUI, id[offset:]...) + mac := append(vmwOUI, id...) return mac.String() } @@ -889,7 +1065,74 @@ func getDiskSize(disk *types.VirtualDisk) int64 { return disk.CapacityInBytes } -func (vm *VirtualMachine) configureDevice(devices object.VirtualDeviceList, spec *types.VirtualDeviceConfigSpec) types.BaseMethodFault { +func changedDiskSize(oldDisk *types.VirtualDisk, newDiskSpec *types.VirtualDisk) (int64, bool) { + // capacity cannot be decreased + if newDiskSpec.CapacityInBytes < oldDisk.CapacityInBytes || newDiskSpec.CapacityInKB < oldDisk.CapacityInKB { + return 0, false + } + + // NOTE: capacity is ignored if specified value is same as before + if newDiskSpec.CapacityInBytes == oldDisk.CapacityInBytes { + return newDiskSpec.CapacityInKB * 1024, true + } + if newDiskSpec.CapacityInKB == oldDisk.CapacityInKB { + return newDiskSpec.CapacityInBytes, true + } + + // CapacityInBytes and CapacityInKB indicate different values + if newDiskSpec.CapacityInBytes != newDiskSpec.CapacityInKB*1024 { + return 0, false + } + return newDiskSpec.CapacityInBytes, true +} + +func (vm *VirtualMachine) validateSwitchMembers(id string) types.BaseMethodFault { + var dswitch *DistributedVirtualSwitch + + var find func(types.ManagedObjectReference) + find = func(child types.ManagedObjectReference) { + s, ok := Map.Get(child).(*DistributedVirtualSwitch) + if ok && s.Uuid == id { + dswitch = s + return + } + walk(Map.Get(child), find) + } + f := Map.getEntityDatacenter(vm).NetworkFolder + walk(Map.Get(f), find) // search in NetworkFolder and any sub folders + + if dswitch == nil { + log.Printf("DVS %s cannot be found", id) + return new(types.NotFound) + } + + h := Map.Get(*vm.Runtime.Host).(*HostSystem) + c := hostParent(&h.HostSystem) + isMember := func(val types.ManagedObjectReference) bool { + for _, mem := range dswitch.Summary.HostMember { + if mem == val { + return true + } + } + log.Printf("%s is not a member of VDS %s", h.Name, dswitch.Name) + return false + } + + for _, ref := range c.Host { + if !isMember(ref) { + return &types.InvalidArgument{InvalidProperty: "spec.deviceChange.device.port.switchUuid"} + } + } + + return nil +} + +func (vm *VirtualMachine) configureDevice( + ctx *Context, + devices object.VirtualDeviceList, + spec *types.VirtualDeviceConfigSpec, + oldDevice types.BaseVirtualDevice) types.BaseMethodFault { + device := spec.Device d := device.GetVirtualDevice() var controller types.BaseVirtualController @@ -910,8 +1153,7 @@ func (vm *VirtualMachine) configureDevice(devices object.VirtualDeviceList, spec label := devices.Name(device) summary := label - dc := Map.getEntityDatacenter(Map.Get(*vm.Parent).(mo.Entity)) - dm := Map.VirtualDiskManager() + dc := ctx.Map.getEntityDatacenter(ctx.Map.Get(*vm.Parent).(mo.Entity)) switch x := device.(type) { case types.BaseVirtualEthernetCard: @@ -923,34 +1165,66 @@ func (vm *VirtualMachine) configureDevice(devices object.VirtualDeviceList, spec case *types.VirtualEthernetCardNetworkBackingInfo: name = b.DeviceName summary = name - net = Map.FindByName(b.DeviceName, dc.Network).Reference() + net = ctx.Map.FindByName(b.DeviceName, dc.Network).Reference() b.Network = &net case *types.VirtualEthernetCardDistributedVirtualPortBackingInfo: summary = fmt.Sprintf("DVSwitch: %s", b.Port.SwitchUuid) net.Type = "DistributedVirtualPortgroup" net.Value = b.Port.PortgroupKey + if err := vm.validateSwitchMembers(b.Port.SwitchUuid); err != nil { + return err + } } - Map.Update(vm, []types.PropertyChange{ + ctx.Map.Update(vm, []types.PropertyChange{ {Name: "summary.config.numEthernetCards", Val: vm.Summary.Config.NumEthernetCards + 1}, {Name: "network", Val: append(vm.Network, net)}, }) c := x.GetVirtualEthernetCard() if c.MacAddress == "" { - c.MacAddress = vm.generateMAC() + if c.UnitNumber == nil { + devices.AssignController(device, controller) + } + c.MacAddress = vm.generateMAC(*c.UnitNumber - 7) // Note 7 == PCI offset } + vm.Guest.Net = append(vm.Guest.Net, types.GuestNicInfo{ + Network: name, + IpAddress: nil, + MacAddress: c.MacAddress, + Connected: true, + DeviceConfigId: c.Key, + }) + if spec.Operation == types.VirtualDeviceConfigSpecOperationAdd { - vm.Guest.Net = append(vm.Guest.Net, types.GuestNicInfo{ - Network: name, - IpAddress: nil, - MacAddress: c.MacAddress, - Connected: true, - DeviceConfigId: c.Key, - }) + if c.ResourceAllocation == nil { + c.ResourceAllocation = &types.VirtualEthernetCardResourceAllocation{ + Reservation: types.NewInt64(0), + Share: types.SharesInfo{ + Shares: 50, + Level: "normal", + }, + Limit: types.NewInt64(-1), + } + } } case *types.VirtualDisk: + if oldDevice == nil { + // NOTE: either of capacityInBytes and capacityInKB may not be specified + x.CapacityInBytes = getDiskSize(x) + x.CapacityInKB = getDiskSize(x) / 1024 + } else { + if oldDisk, ok := oldDevice.(*types.VirtualDisk); ok { + diskSize, ok := changedDiskSize(oldDisk, x) + if !ok { + return &types.InvalidDeviceOperation{} + } + x.CapacityInBytes = diskSize + x.CapacityInKB = diskSize / 1024 + } + } + summary = fmt.Sprintf("%s KB", numberToString(x.CapacityInKB, ',')) switch b := d.Backing.(type) { case types.BaseVirtualDeviceFileBackingInfo: @@ -967,7 +1241,7 @@ func (vm *VirtualMachine) configureDevice(devices object.VirtualDeviceList, spec info.FileName = filename } - err := dm.createVirtualDisk(spec.FileOperation, &types.CreateVirtualDisk_Task{ + err := vdmCreateVirtualDisk(spec.FileOperation, &types.CreateVirtualDisk_Task{ Datacenter: &dc.Self, Name: info.FileName, }) @@ -975,25 +1249,64 @@ func (vm *VirtualMachine) configureDevice(devices object.VirtualDeviceList, spec return err } - Map.Update(vm, []types.PropertyChange{ + ctx.Map.Update(vm, []types.PropertyChange{ {Name: "summary.config.numVirtualDisks", Val: vm.Summary.Config.NumVirtualDisks + 1}, }) p, _ := parseDatastorePath(info.FileName) + ds := vm.findDatastore(p.Datastore) + info.Datastore = &ds.Self - host := Map.Get(*vm.Runtime.Host).(*HostSystem) - - entity := Map.FindByName(p.Datastore, host.Datastore) - ref := entity.Reference() - info.Datastore = &ref - - ds := entity.(*Datastore) + if oldDevice != nil { + if oldDisk, ok := oldDevice.(*types.VirtualDisk); ok { + // add previous capacity to datastore freespace + ctx.WithLock(ds, func() { + ds.Summary.FreeSpace += getDiskSize(oldDisk) + ds.Info.GetDatastoreInfo().FreeSpace = ds.Summary.FreeSpace + }) + } + } + // then subtract new capacity from datastore freespace // XXX: compare disk size and free space until windows stat is supported - ds.Summary.FreeSpace -= getDiskSize(x) - ds.Info.GetDatastoreInfo().FreeSpace = ds.Summary.FreeSpace + ctx.WithLock(ds, func() { + ds.Summary.FreeSpace -= getDiskSize(x) + ds.Info.GetDatastoreInfo().FreeSpace = ds.Summary.FreeSpace + }) vm.updateDiskLayouts() + + if disk, ok := b.(*types.VirtualDiskFlatVer2BackingInfo); ok { + // These properties default to false + props := []**bool{ + &disk.EagerlyScrub, + &disk.ThinProvisioned, + &disk.WriteThrough, + &disk.Split, + &disk.DigestEnabled, + } + for _, prop := range props { + if *prop == nil { + *prop = types.NewBool(false) + } + } + disk.Uuid = virtualDiskUUID(&dc.Self, info.FileName) + } + } + case *types.VirtualCdrom: + if b, ok := d.Backing.(types.BaseVirtualDeviceFileBackingInfo); ok { + summary = "ISO " + b.GetVirtualDeviceFileBackingInfo().FileName + } + case *types.VirtualFloppy: + if b, ok := d.Backing.(types.BaseVirtualDeviceFileBackingInfo); ok { + summary = "Image " + b.GetVirtualDeviceFileBackingInfo().FileName + } + case *types.VirtualSerialPort: + switch b := d.Backing.(type) { + case types.BaseVirtualDeviceFileBackingInfo: + summary = "File " + b.GetVirtualDeviceFileBackingInfo().FileName + case *types.VirtualSerialPortURIBackingInfo: + summary = "Remote " + b.ServiceURI } } @@ -1006,12 +1319,34 @@ func (vm *VirtualMachine) configureDevice(devices object.VirtualDeviceList, spec Label: label, Summary: summary, } + } else { + info := d.DeviceInfo.GetDescription() + if info.Label == "" { + info.Label = label + } + if info.Summary == "" { + info.Summary = summary + } + } + + switch device.(type) { + case types.BaseVirtualEthernetCard, *types.VirtualCdrom, *types.VirtualFloppy, *types.VirtualUSB, *types.VirtualSerialPort: + if d.Connectable == nil { + d.Connectable = &types.VirtualDeviceConnectInfo{StartConnected: true, Connected: true} + } + } + + // device can be connected only if vm is powered on + if vm.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOn { + if d.Connectable != nil { + d.Connectable.Connected = false + } } return nil } -func (vm *VirtualMachine) removeDevice(devices object.VirtualDeviceList, spec *types.VirtualDeviceConfigSpec) object.VirtualDeviceList { +func (vm *VirtualMachine) removeDevice(ctx *Context, devices object.VirtualDeviceList, spec *types.VirtualDeviceConfigSpec) object.VirtualDeviceList { key := spec.Device.GetVirtualDevice().Key for i, d := range devices { @@ -1031,26 +1366,29 @@ func (vm *VirtualMachine) removeDevice(devices object.VirtualDeviceList, spec *t file = b.GetVirtualDeviceFileBackingInfo().FileName p, _ := parseDatastorePath(file) + ds := vm.findDatastore(p.Datastore) - host := Map.Get(*vm.Runtime.Host).(*HostSystem) - - ds := Map.FindByName(p.Datastore, host.Datastore).(*Datastore) - - ds.Summary.FreeSpace += getDiskSize(device) - ds.Info.GetDatastoreInfo().FreeSpace = ds.Summary.FreeSpace + ctx.WithLock(ds, func() { + ds.Summary.FreeSpace += getDiskSize(device) + ds.Info.GetDatastoreInfo().FreeSpace = ds.Summary.FreeSpace + }) } if file != "" { - dc := Map.getEntityDatacenter(Map.Get(*vm.Parent).(mo.Entity)) - dm := Map.VirtualDiskManager() - - dm.DeleteVirtualDiskTask(&types.DeleteVirtualDisk_Task{ + dc := ctx.Map.getEntityDatacenter(vm) + dm := ctx.Map.VirtualDiskManager() + if dc == nil { + continue // parent was destroyed + } + res := dm.DeleteVirtualDiskTask(ctx, &types.DeleteVirtualDisk_Task{ Name: file, Datacenter: &dc.Self, }) + ctask := ctx.Map.Get(res.(*methods.DeleteVirtualDisk_TaskBody).Res.Returnval).(*Task) + ctask.Wait() } } - Map.Update(vm, []types.PropertyChange{ + ctx.Map.Update(vm, []types.PropertyChange{ {Name: "summary.config.numVirtualDisks", Val: vm.Summary.Config.NumVirtualDisks - 1}, }) @@ -1066,9 +1404,16 @@ func (vm *VirtualMachine) removeDevice(devices object.VirtualDeviceList, spec *t net.Value = b.Port.PortgroupKey } + for j, nicInfo := range vm.Guest.Net { + if nicInfo.DeviceConfigId == key { + vm.Guest.Net = append(vm.Guest.Net[:j], vm.Guest.Net[j+1:]...) + break + } + } + networks := vm.Network RemoveReference(&networks, net) - Map.Update(vm, []types.PropertyChange{ + ctx.Map.Update(vm, []types.PropertyChange{ {Name: "summary.config.numEthernetCards", Val: vm.Summary.Config.NumEthernetCards - 1}, {Name: "network", Val: networks}, }) @@ -1117,7 +1462,7 @@ func (vm *VirtualMachine) genVmdkPath(p object.DatastorePath) (string, types.Bas } } -func (vm *VirtualMachine) configureDevices(spec *types.VirtualMachineConfigSpec) types.BaseMethodFault { +func (vm *VirtualMachine) configureDevices(ctx *Context, spec *types.VirtualMachineConfigSpec) types.BaseMethodFault { devices := object.VirtualDeviceList(vm.Config.Hardware.Device) for i, change := range spec.DeviceChange { @@ -1125,6 +1470,16 @@ func (vm *VirtualMachine) configureDevices(spec *types.VirtualMachineConfigSpec) device := dspec.Device.GetVirtualDevice() invalid := &types.InvalidDeviceSpec{DeviceIndex: int32(i)} + switch dspec.FileOperation { + case types.VirtualDeviceConfigSpecFileOperationCreate: + switch dspec.Device.(type) { + case *types.VirtualDisk: + if device.UnitNumber == nil { + return invalid + } + } + } + switch dspec.Operation { case types.VirtualDeviceConfigSpecOperationAdd: if devices.FindByKey(device.Key) != nil && device.ControllerKey == 0 { @@ -1145,38 +1500,53 @@ func (vm *VirtualMachine) configureDevices(spec *types.VirtualMachineConfigSpec) return invalid } - err := vm.configureDevice(devices, dspec) + key := device.Key + err := vm.configureDevice(ctx, devices, dspec, nil) if err != nil { return err } devices = append(devices, dspec.Device) + if key != device.Key { + // Update ControllerKey refs + for i := range spec.DeviceChange { + ckey := &spec.DeviceChange[i].GetVirtualDeviceConfigSpec().Device.GetVirtualDevice().ControllerKey + if *ckey == key { + *ckey = device.Key + } + } + } case types.VirtualDeviceConfigSpecOperationEdit: rspec := *dspec - rspec.Device = devices.FindByKey(device.Key) - if rspec.Device == nil { + oldDevice := devices.FindByKey(device.Key) + if oldDevice == nil { return invalid } - devices = vm.removeDevice(devices, &rspec) - device.DeviceInfo = nil // regenerate summary + label + rspec.Device = oldDevice + devices = vm.removeDevice(ctx, devices, &rspec) + if device.DeviceInfo != nil { + device.DeviceInfo.GetDescription().Summary = "" // regenerate summary + } - err := vm.configureDevice(devices, dspec) + err := vm.configureDevice(ctx, devices, dspec, oldDevice) if err != nil { return err } devices = append(devices, dspec.Device) case types.VirtualDeviceConfigSpecOperationRemove: - devices = vm.removeDevice(devices, dspec) + devices = vm.removeDevice(ctx, devices, dspec) } } - Map.Update(vm, []types.PropertyChange{ + ctx.Map.Update(vm, []types.PropertyChange{ {Name: "config.hardware.device", Val: []types.BaseVirtualDevice(devices)}, }) vm.updateDiskLayouts() + vm.applyExtraConfig(spec) // Do this after device config, as some may apply to the devices themselves (e.g. ethernet -> guest.net) + return nil } @@ -1206,29 +1576,58 @@ func (c *powerVMTask) Run(task *Task) (types.AnyType, types.BaseMethodFault) { event := c.event() switch c.state { case types.VirtualMachinePowerStatePoweredOn: - c.run.start(c.VirtualMachine) + if c.VirtualMachine.hostInMM(c.ctx) { + return nil, new(types.InvalidState) + } + + c.run.start(c.ctx, c.VirtualMachine) c.ctx.postEvent( &types.VmStartingEvent{VmEvent: event}, &types.VmPoweredOnEvent{VmEvent: event}, ) + c.customize(c.ctx) case types.VirtualMachinePowerStatePoweredOff: - c.run.stop(c.VirtualMachine) + c.run.stop(c.ctx, c.VirtualMachine) c.ctx.postEvent( &types.VmStoppingEvent{VmEvent: event}, &types.VmPoweredOffEvent{VmEvent: event}, ) case types.VirtualMachinePowerStateSuspended: - c.run.pause(c.VirtualMachine) + if c.VirtualMachine.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOn { + return nil, &types.InvalidPowerState{ + RequestedState: types.VirtualMachinePowerStatePoweredOn, + ExistingState: c.VirtualMachine.Runtime.PowerState, + } + } + + c.run.pause(c.ctx, c.VirtualMachine) c.ctx.postEvent( &types.VmSuspendingEvent{VmEvent: event}, &types.VmSuspendedEvent{VmEvent: event}, ) } - Map.Update(c.VirtualMachine, []types.PropertyChange{ + // copy devices to prevent data race + devices := c.VirtualMachine.cloneDevice() + for _, d := range devices { + conn := d.GetVirtualDevice().Connectable + if conn == nil { + continue + } + + if c.state == types.VirtualMachinePowerStatePoweredOn { + // apply startConnected to current connection + conn.Connected = conn.StartConnected + } else { + conn.Connected = false + } + } + + c.ctx.Map.Update(c.VirtualMachine, []types.PropertyChange{ {Name: "runtime.powerState", Val: c.state}, {Name: "summary.runtime.powerState", Val: c.state}, {Name: "summary.runtime.bootTime", Val: boot}, + {Name: "config.hardware.device", Val: devices}, }) return nil, nil @@ -1246,7 +1645,7 @@ func (vm *VirtualMachine) PowerOnVMTask(ctx *Context, c *types.PowerOnVM_Task) s return &methods.PowerOnVM_TaskBody{ Res: &types.PowerOnVM_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } @@ -1257,7 +1656,7 @@ func (vm *VirtualMachine) PowerOffVMTask(ctx *Context, c *types.PowerOffVM_Task) return &methods.PowerOffVM_TaskBody{ Res: &types.PowerOffVM_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } @@ -1268,7 +1667,7 @@ func (vm *VirtualMachine) SuspendVMTask(ctx *Context, req *types.SuspendVM_Task) return &methods.SuspendVM_TaskBody{ Res: &types.SuspendVM_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } @@ -1276,51 +1675,83 @@ func (vm *VirtualMachine) SuspendVMTask(ctx *Context, req *types.SuspendVM_Task) func (vm *VirtualMachine) ResetVMTask(ctx *Context, req *types.ResetVM_Task) soap.HasFault { task := CreateTask(vm, "reset", func(task *Task) (types.AnyType, types.BaseMethodFault) { res := vm.PowerOffVMTask(ctx, &types.PowerOffVM_Task{This: vm.Self}) - ctask := Map.Get(res.(*methods.PowerOffVM_TaskBody).Res.Returnval).(*Task) + ctask := ctx.Map.Get(res.(*methods.PowerOffVM_TaskBody).Res.Returnval).(*Task) + ctask.Wait() if ctask.Info.Error != nil { return nil, ctask.Info.Error.Fault } - _ = vm.PowerOnVMTask(ctx, &types.PowerOnVM_Task{This: vm.Self}) + res = vm.PowerOnVMTask(ctx, &types.PowerOnVM_Task{This: vm.Self}) + ctask = ctx.Map.Get(res.(*methods.PowerOnVM_TaskBody).Res.Returnval).(*Task) + ctask.Wait() return nil, nil }) return &methods.ResetVM_TaskBody{ Res: &types.ResetVM_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } +func (vm *VirtualMachine) RebootGuest(ctx *Context, req *types.RebootGuest) soap.HasFault { + body := new(methods.RebootGuestBody) + + if vm.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOn { + body.Fault_ = Fault("", &types.InvalidPowerState{ + RequestedState: types.VirtualMachinePowerStatePoweredOn, + ExistingState: vm.Runtime.PowerState, + }) + return body + } + + if vm.Guest.ToolsRunningStatus == string(types.VirtualMachineToolsRunningStatusGuestToolsRunning) { + vm.run.restart(ctx, vm) + body.Res = new(types.RebootGuestResponse) + } else { + body.Fault_ = Fault("", new(types.ToolsUnavailable)) + } + + return body +} + func (vm *VirtualMachine) ReconfigVMTask(ctx *Context, req *types.ReconfigVM_Task) soap.HasFault { task := CreateTask(vm, "reconfigVm", func(t *Task) (types.AnyType, types.BaseMethodFault) { - err := vm.configure(&req.Spec) - if err != nil { - return nil, err - } - ctx.postEvent(&types.VmReconfiguredEvent{ VmEvent: vm.event(), ConfigSpec: req.Spec, }) - return nil, nil + if vm.Config.Template { + expect := types.VirtualMachineConfigSpec{ + Name: req.Spec.Name, + Annotation: req.Spec.Annotation, + } + if !reflect.DeepEqual(&req.Spec, &expect) { + log.Printf("template reconfigure only allows name and annotation change") + return nil, new(types.NotSupported) + } + } + + err := vm.configure(ctx, &req.Spec) + + return nil, err }) return &methods.ReconfigVM_TaskBody{ Res: &types.ReconfigVM_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (vm *VirtualMachine) UpgradeVMTask(req *types.UpgradeVM_Task) soap.HasFault { +func (vm *VirtualMachine) UpgradeVMTask(ctx *Context, req *types.UpgradeVM_Task) soap.HasFault { body := &methods.UpgradeVM_TaskBody{} task := CreateTask(vm, "upgradeVm", func(t *Task) (types.AnyType, types.BaseMethodFault) { if vm.Config.Version != esx.HardwareVersion { - Map.Update(vm, []types.PropertyChange{{ + ctx.Map.Update(vm, []types.PropertyChange{{ Name: "config.version", Val: esx.HardwareVersion, }}) } @@ -1328,14 +1759,20 @@ func (vm *VirtualMachine) UpgradeVMTask(req *types.UpgradeVM_Task) soap.HasFault }) body.Res = &types.UpgradeVM_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), } return body } func (vm *VirtualMachine) DestroyTask(ctx *Context, req *types.Destroy_Task) soap.HasFault { + dc := ctx.Map.getEntityDatacenter(vm) + task := CreateTask(vm, "destroy", func(t *Task) (types.AnyType, types.BaseMethodFault) { + if dc == nil { + return nil, &types.ManagedObjectNotFound{Obj: vm.Self} // If our Parent was destroyed, so were we. + } + r := vm.UnregisterVM(ctx, &types.UnregisterVM{ This: req.This, }) @@ -1347,16 +1784,15 @@ func (vm *VirtualMachine) DestroyTask(ctx *Context, req *types.Destroy_Task) soa // Remove all devices devices := object.VirtualDeviceList(vm.Config.Hardware.Device) spec, _ := devices.ConfigSpec(types.VirtualDeviceConfigSpecOperationRemove) - vm.configureDevices(&types.VirtualMachineConfigSpec{DeviceChange: spec}) + vm.configureDevices(ctx, &types.VirtualMachineConfigSpec{DeviceChange: spec}) // Delete VM files from the datastore (ignoring result for now) - m := Map.FileManager() - dc := Map.getEntityDatacenter(vm).Reference() + m := ctx.Map.FileManager() - _ = m.DeleteDatastoreFileTask(&types.DeleteDatastoreFile_Task{ + _ = m.DeleteDatastoreFileTask(ctx, &types.DeleteDatastoreFile_Task{ This: m.Reference(), Name: vm.Config.Files.LogDirectory, - Datacenter: &dc, + Datacenter: &dc.Self, }) vm.run.remove(vm) @@ -1366,7 +1802,7 @@ func (vm *VirtualMachine) DestroyTask(ctx *Context, req *types.Destroy_Task) soa return &methods.Destroy_TaskBody{ Res: &types.Destroy_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } @@ -1387,55 +1823,112 @@ func (vm *VirtualMachine) UnregisterVM(ctx *Context, c *types.UnregisterVM) soap return r } - host := Map.Get(*vm.Runtime.Host).(*HostSystem) - Map.RemoveReference(host, &host.Vm, vm.Self) + host := ctx.Map.Get(*vm.Runtime.Host).(*HostSystem) + ctx.Map.RemoveReference(ctx, host, &host.Vm, vm.Self) - switch pool := Map.Get(*vm.ResourcePool).(type) { - case *ResourcePool: - Map.RemoveReference(pool, &pool.Vm, vm.Self) - case *VirtualApp: - Map.RemoveReference(pool, &pool.Vm, vm.Self) + if vm.ResourcePool != nil { + switch pool := ctx.Map.Get(*vm.ResourcePool).(type) { + case *ResourcePool: + ctx.Map.RemoveReference(ctx, pool, &pool.Vm, vm.Self) + case *VirtualApp: + ctx.Map.RemoveReference(ctx, pool, &pool.Vm, vm.Self) + } } for i := range vm.Datastore { - ds := Map.Get(vm.Datastore[i]).(*Datastore) - Map.RemoveReference(ds, &ds.Vm, vm.Self) + ds := ctx.Map.Get(vm.Datastore[i]).(*Datastore) + ctx.Map.RemoveReference(ctx, ds, &ds.Vm, vm.Self) } ctx.postEvent(&types.VmRemovedEvent{VmEvent: vm.event()}) - Map.getEntityParent(vm, "Folder").(*Folder).removeChild(c.This) + if f, ok := asFolderMO(ctx.Map.getEntityParent(vm, "Folder")); ok { + folderRemoveChild(ctx, f, c.This) + } r.Res = new(types.UnregisterVMResponse) return r } +type vmFolder interface { + CreateVMTask(ctx *Context, c *types.CreateVM_Task) soap.HasFault +} + +func (vm *VirtualMachine) cloneDevice() []types.BaseVirtualDevice { + src := types.ArrayOfVirtualDevice{ + VirtualDevice: vm.Config.Hardware.Device, + } + dst := types.ArrayOfVirtualDevice{} + deepCopy(src, &dst) + return dst.VirtualDevice +} + func (vm *VirtualMachine) CloneVMTask(ctx *Context, req *types.CloneVM_Task) soap.HasFault { - ctx.Caller = &vm.Self - folder := Map.Get(req.Folder).(*Folder) - host := Map.Get(*vm.Runtime.Host).(*HostSystem) + pool := req.Spec.Location.Pool + if pool == nil { + if !vm.Config.Template { + pool = vm.ResourcePool + } + } + + destHost := vm.Runtime.Host + + if req.Spec.Location.Host != nil { + destHost = req.Spec.Location.Host + } + + folder, _ := asFolderMO(ctx.Map.Get(req.Folder)) + host := ctx.Map.Get(*destHost).(*HostSystem) event := vm.event() ctx.postEvent(&types.VmBeingClonedEvent{ VmCloneEvent: types.VmCloneEvent{ VmEvent: event, }, - DestFolder: folder.eventArgument(), + DestFolder: folderEventArgument(folder), DestName: req.Name, DestHost: *host.eventArgument(), }) + vmx := vm.vmx(nil) + vmx.Path = req.Name + if ref := req.Spec.Location.Datastore; ref != nil { + ds := ctx.Map.Get(*ref).(*Datastore).Name + vmx.Datastore = ds + } + task := CreateTask(vm, "cloneVm", func(t *Task) (types.AnyType, types.BaseMethodFault) { + if pool == nil { + return nil, &types.InvalidArgument{InvalidProperty: "spec.location.pool"} + } + if obj := ctx.Map.FindByName(req.Name, folder.ChildEntity); obj != nil { + return nil, &types.DuplicateName{ + Name: req.Name, + Object: obj.Reference(), + } + } config := types.VirtualMachineConfigSpec{ Name: req.Name, GuestId: vm.Config.GuestId, Files: &types.VirtualMachineFileInfo{ - VmPathName: strings.Replace(vm.Config.Files.VmPathName, vm.Name, req.Name, -1), + VmPathName: vmx.String(), }, } + if req.Spec.Config != nil { + config.ExtraConfig = req.Spec.Config.ExtraConfig + config.InstanceUuid = req.Spec.Config.InstanceUuid + } + + // Copying hardware properties + config.NumCPUs = vm.Config.Hardware.NumCPU + config.MemoryMB = int64(vm.Config.Hardware.MemoryMB) + config.NumCoresPerSocket = vm.Config.Hardware.NumCoresPerSocket + config.VirtualICH7MPresent = vm.Config.Hardware.VirtualICH7MPresent + config.VirtualSMCPresent = vm.Config.Hardware.VirtualSMCPresent defaultDevices := object.VirtualDeviceList(esx.VirtualDevice) - devices := vm.Config.Hardware.Device + devices := vm.cloneDevice() + for _, device := range devices { var fop types.VirtualDeviceConfigSpecFileOperation @@ -1461,23 +1954,28 @@ func (vm *VirtualMachine) CloneVMTask(ctx *Context, req *types.CloneVM_Task) soa }) } - res := folder.CreateVMTask(ctx, &types.CreateVM_Task{ + res := ctx.Map.Get(req.Folder).(vmFolder).CreateVMTask(ctx, &types.CreateVM_Task{ This: folder.Self, Config: config, - Pool: *vm.ResourcePool, - Host: vm.Runtime.Host, + Pool: *pool, + Host: destHost, }) - ctask := Map.Get(res.(*methods.CreateVM_TaskBody).Res.Returnval).(*Task) + ctask := ctx.Map.Get(res.(*methods.CreateVM_TaskBody).Res.Returnval).(*Task) + ctask.Wait() if ctask.Info.Error != nil { return nil, ctask.Info.Error.Fault } ref := ctask.Info.Result.(types.ManagedObjectReference) - clone := Map.Get(ref).(*VirtualMachine) - clone.configureDevices(&types.VirtualMachineConfigSpec{DeviceChange: req.Spec.Location.DeviceChange}) + clone := ctx.Map.Get(ref).(*VirtualMachine) + clone.configureDevices(ctx, &types.VirtualMachineConfigSpec{DeviceChange: req.Spec.Location.DeviceChange}) if req.Spec.Config != nil && req.Spec.Config.DeviceChange != nil { - clone.configureDevices(&types.VirtualMachineConfigSpec{DeviceChange: req.Spec.Config.DeviceChange}) + clone.configureDevices(ctx, &types.VirtualMachineConfigSpec{DeviceChange: req.Spec.Config.DeviceChange}) + } + + if req.Spec.Template { + _ = clone.MarkAsTemplate(&types.MarkAsTemplate{This: clone.Self}) } ctx.postEvent(&types.VmClonedEvent{ @@ -1490,18 +1988,18 @@ func (vm *VirtualMachine) CloneVMTask(ctx *Context, req *types.CloneVM_Task) soa return &methods.CloneVM_TaskBody{ Res: &types.CloneVM_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (vm *VirtualMachine) RelocateVMTask(req *types.RelocateVM_Task) soap.HasFault { +func (vm *VirtualMachine) RelocateVMTask(ctx *Context, req *types.RelocateVM_Task) soap.HasFault { task := CreateTask(vm, "relocateVm", func(t *Task) (types.AnyType, types.BaseMethodFault) { var changes []types.PropertyChange if ref := req.Spec.Datastore; ref != nil { - ds := Map.Get(*ref).(*Datastore) - Map.RemoveReference(ds, &ds.Vm, *ref) + ds := ctx.Map.Get(*ref).(*Datastore) + ctx.Map.RemoveReference(ctx, ds, &ds.Vm, *ref) // TODO: migrate vm.Config.Files, vm.Summary.Config.VmPathName, vm.Layout and vm.LayoutEx @@ -1509,15 +2007,15 @@ func (vm *VirtualMachine) RelocateVMTask(req *types.RelocateVM_Task) soap.HasFau } if ref := req.Spec.Pool; ref != nil { - pool := Map.Get(*ref).(*ResourcePool) - Map.RemoveReference(pool, &pool.Vm, *ref) + pool := ctx.Map.Get(*ref).(*ResourcePool) + ctx.Map.RemoveReference(ctx, pool, &pool.Vm, *ref) changes = append(changes, types.PropertyChange{Name: "resourcePool", Val: ref}) } if ref := req.Spec.Host; ref != nil { - host := Map.Get(*ref).(*HostSystem) - Map.RemoveReference(host, &host.Vm, *ref) + host := ctx.Map.Get(*ref).(*HostSystem) + ctx.Map.RemoveReference(ctx, host, &host.Vm, *ref) changes = append(changes, types.PropertyChange{Name: "runtime.host", Val: ref}, @@ -1525,19 +2023,151 @@ func (vm *VirtualMachine) RelocateVMTask(req *types.RelocateVM_Task) soap.HasFau ) } - Map.Update(vm, changes) + if ref := req.Spec.Folder; ref != nil { + folder := ctx.Map.Get(*ref).(*Folder) + folder.MoveIntoFolderTask(ctx, &types.MoveIntoFolder_Task{ + List: []types.ManagedObjectReference{vm.Self}, + }) + } + + ctx.postEvent(&types.VmMigratedEvent{ + VmEvent: vm.event(), + SourceHost: *ctx.Map.Get(*vm.Runtime.Host).(*HostSystem).eventArgument(), + SourceDatacenter: datacenterEventArgument(vm), + SourceDatastore: ctx.Map.Get(vm.Datastore[0]).(*Datastore).eventArgument(), + }) + + ctx.Map.Update(vm, changes) return nil, nil }) return &methods.RelocateVM_TaskBody{ Res: &types.RelocateVM_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (vm *VirtualMachine) CreateSnapshotTask(req *types.CreateSnapshot_Task) soap.HasFault { +func (vm *VirtualMachine) customize(ctx *Context) { + if vm.imc == nil { + return + } + + event := types.CustomizationEvent{VmEvent: vm.event()} + ctx.postEvent(&types.CustomizationStartedEvent{CustomizationEvent: event}) + + changes := []types.PropertyChange{ + {Name: "config.tools.pendingCustomization", Val: ""}, + } + + hostname := "" + address := "" + + switch c := vm.imc.Identity.(type) { + case *types.CustomizationLinuxPrep: + hostname = customizeName(vm, c.HostName) + case *types.CustomizationSysprep: + hostname = customizeName(vm, c.UserData.ComputerName) + } + + cards := object.VirtualDeviceList(vm.Config.Hardware.Device).SelectByType((*types.VirtualEthernetCard)(nil)) + + for i, s := range vm.imc.NicSettingMap { + nic := &vm.Guest.Net[i] + if s.MacAddress != "" { + nic.MacAddress = strings.ToLower(s.MacAddress) // MacAddress in guest will always be lowercase + card := cards[i].(types.BaseVirtualEthernetCard).GetVirtualEthernetCard() + card.MacAddress = s.MacAddress // MacAddress in Virtual NIC can be any case + card.AddressType = string(types.VirtualEthernetCardMacTypeManual) + } + if nic.DnsConfig == nil { + nic.DnsConfig = new(types.NetDnsConfigInfo) + } + if s.Adapter.DnsDomain != "" { + nic.DnsConfig.DomainName = s.Adapter.DnsDomain + } + if len(s.Adapter.DnsServerList) != 0 { + nic.DnsConfig.IpAddress = s.Adapter.DnsServerList + } + if hostname != "" { + nic.DnsConfig.HostName = hostname + } + if len(vm.imc.GlobalIPSettings.DnsSuffixList) != 0 { + nic.DnsConfig.SearchDomain = vm.imc.GlobalIPSettings.DnsSuffixList + } + if nic.IpConfig == nil { + nic.IpConfig = new(types.NetIpConfigInfo) + } + + switch ip := s.Adapter.Ip.(type) { + case *types.CustomizationCustomIpGenerator: + case *types.CustomizationDhcpIpGenerator: + case *types.CustomizationFixedIp: + if address == "" { + address = ip.IpAddress + } + nic.IpAddress = []string{ip.IpAddress} + nic.IpConfig.IpAddress = []types.NetIpConfigInfoIpAddress{{ + IpAddress: ip.IpAddress, + }} + case *types.CustomizationUnknownIpGenerator: + } + } + + if len(vm.imc.NicSettingMap) != 0 { + changes = append(changes, types.PropertyChange{Name: "guest.net", Val: vm.Guest.Net}) + } + if hostname != "" { + changes = append(changes, types.PropertyChange{Name: "guest.hostName", Val: hostname}) + changes = append(changes, types.PropertyChange{Name: "summary.guest.hostName", Val: hostname}) + } + if address != "" { + changes = append(changes, types.PropertyChange{Name: "guest.ipAddress", Val: address}) + changes = append(changes, types.PropertyChange{Name: "summary.guest.ipAddress", Val: address}) + } + + vm.imc = nil + ctx.Map.Update(vm, changes) + ctx.postEvent(&types.CustomizationSucceeded{CustomizationEvent: event}) +} + +func (vm *VirtualMachine) CustomizeVMTask(ctx *Context, req *types.CustomizeVM_Task) soap.HasFault { + task := CreateTask(vm, "customizeVm", func(t *Task) (types.AnyType, types.BaseMethodFault) { + if vm.hostInMM(ctx) { + return nil, new(types.InvalidState) + } + + if vm.Runtime.PowerState == types.VirtualMachinePowerStatePoweredOn { + return nil, &types.InvalidPowerState{ + RequestedState: types.VirtualMachinePowerStatePoweredOff, + ExistingState: vm.Runtime.PowerState, + } + } + if vm.Config.Tools.PendingCustomization != "" { + return nil, new(types.CustomizationPending) + } + if len(vm.Guest.Net) != len(req.Spec.NicSettingMap) { + return nil, &types.NicSettingMismatch{ + NumberOfNicsInSpec: int32(len(req.Spec.NicSettingMap)), + NumberOfNicsInVM: int32(len(vm.Guest.Net)), + } + } + + vm.imc = &req.Spec + vm.Config.Tools.PendingCustomization = uuid.New().String() + + return nil, nil + }) + + return &methods.CustomizeVM_TaskBody{ + Res: &types.CustomizeVM_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (vm *VirtualMachine) CreateSnapshotTask(ctx *Context, req *types.CreateSnapshot_Task) soap.HasFault { task := CreateTask(vm, "createSnapshot", func(t *Task) (types.AnyType, types.BaseMethodFault) { var changes []types.PropertyChange @@ -1549,7 +2179,7 @@ func (vm *VirtualMachine) CreateSnapshotTask(req *types.CreateSnapshot_Task) soa snapshot.Vm = vm.Reference() snapshot.Config = *vm.Config - Map.Put(snapshot) + ctx.Map.Put(snapshot) treeItem := types.VirtualMachineSnapshotTree{ Snapshot: snapshot.Self, @@ -1566,7 +2196,7 @@ func (vm *VirtualMachine) CreateSnapshotTask(req *types.CreateSnapshot_Task) soa cur := vm.Snapshot.CurrentSnapshot if cur != nil { - parent := Map.Get(*cur).(*VirtualMachineSnapshot) + parent := ctx.Map.Get(*cur).(*VirtualMachineSnapshot) parent.ChildSnapshot = append(parent.ChildSnapshot, snapshot.Self) ss := findSnapshotInTree(vm.Snapshot.RootSnapshotList, *cur) @@ -1576,24 +2206,28 @@ func (vm *VirtualMachine) CreateSnapshotTask(req *types.CreateSnapshot_Task) soa Name: "snapshot.rootSnapshotList", Val: append(vm.Snapshot.RootSnapshotList, treeItem), }) + changes = append(changes, types.PropertyChange{ + Name: "rootSnapshot", + Val: append(vm.RootSnapshot, treeItem.Snapshot), + }) } snapshot.createSnapshotFiles() changes = append(changes, types.PropertyChange{Name: "snapshot.currentSnapshot", Val: snapshot.Self}) - Map.Update(vm, changes) + ctx.Map.Update(vm, changes) - return nil, nil + return snapshot.Self, nil }) return &methods.CreateSnapshot_TaskBody{ Res: &types.CreateSnapshot_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (vm *VirtualMachine) RevertToCurrentSnapshotTask(req *types.RevertToCurrentSnapshot_Task) soap.HasFault { +func (vm *VirtualMachine) RevertToCurrentSnapshotTask(ctx *Context, req *types.RevertToCurrentSnapshot_Task) soap.HasFault { body := &methods.RevertToCurrentSnapshot_TaskBody{} if vm.Snapshot == nil || vm.Snapshot.CurrentSnapshot == nil { @@ -1607,7 +2241,7 @@ func (vm *VirtualMachine) RevertToCurrentSnapshotTask(req *types.RevertToCurrent }) body.Res = &types.RevertToCurrentSnapshot_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), } return body @@ -1621,13 +2255,14 @@ func (vm *VirtualMachine) RemoveAllSnapshotsTask(ctx *Context, req *types.Remove refs := allSnapshotsInTree(vm.Snapshot.RootSnapshotList) - Map.Update(vm, []types.PropertyChange{ + ctx.Map.Update(vm, []types.PropertyChange{ {Name: "snapshot", Val: nil}, + {Name: "rootSnapshot", Val: nil}, }) for _, ref := range refs { - Map.Get(ref).(*VirtualMachineSnapshot).removeSnapshotFiles(ctx) - Map.Remove(ref) + ctx.Map.Get(ref).(*VirtualMachineSnapshot).removeSnapshotFiles(ctx) + ctx.Map.Remove(ctx, ref) } return nil, nil @@ -1635,7 +2270,7 @@ func (vm *VirtualMachine) RemoveAllSnapshotsTask(ctx *Context, req *types.Remove return &methods.RemoveAllSnapshots_TaskBody{ Res: &types.RemoveAllSnapshots_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } @@ -1660,9 +2295,9 @@ func (vm *VirtualMachine) ShutdownGuest(ctx *Context, c *types.ShutdownGuest) so &types.VmGuestShutdownEvent{VmEvent: event}, &types.VmPoweredOffEvent{VmEvent: event}, ) - vm.run.stop(vm) + vm.run.stop(ctx, vm) - Map.Update(vm, []types.PropertyChange{ + ctx.Map.Update(vm, []types.PropertyChange{ {Name: "runtime.powerState", Val: types.VirtualMachinePowerStatePoweredOff}, {Name: "summary.runtime.powerState", Val: types.VirtualMachinePowerStatePoweredOff}, }) @@ -1675,6 +2310,11 @@ func (vm *VirtualMachine) ShutdownGuest(ctx *Context, c *types.ShutdownGuest) so func (vm *VirtualMachine) MarkAsTemplate(req *types.MarkAsTemplate) soap.HasFault { r := &methods.MarkAsTemplateBody{} + if vm.Config.Template { + r.Fault_ = Fault("", new(types.NotSupported)) + return r + } + if vm.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOff { r.Fault_ = Fault("", &types.InvalidPowerState{ RequestedState: types.VirtualMachinePowerStatePoweredOff, @@ -1684,8 +2324,38 @@ func (vm *VirtualMachine) MarkAsTemplate(req *types.MarkAsTemplate) soap.HasFaul } vm.Config.Template = true + vm.Summary.Config.Template = true + vm.ResourcePool = nil - r.Res = &types.MarkAsTemplateResponse{} + r.Res = new(types.MarkAsTemplateResponse) + + return r +} + +func (vm *VirtualMachine) MarkAsVirtualMachine(req *types.MarkAsVirtualMachine) soap.HasFault { + r := &methods.MarkAsVirtualMachineBody{} + + if !vm.Config.Template { + r.Fault_ = Fault("", new(types.NotSupported)) + return r + } + + if vm.Runtime.PowerState != types.VirtualMachinePowerStatePoweredOff { + r.Fault_ = Fault("", &types.InvalidPowerState{ + RequestedState: types.VirtualMachinePowerStatePoweredOff, + ExistingState: vm.Runtime.PowerState, + }) + return r + } + + vm.Config.Template = false + vm.Summary.Config.Template = false + vm.ResourcePool = &req.Pool + if req.Host != nil { + vm.Runtime.Host = req.Host + } + + r.Res = new(types.MarkAsVirtualMachineResponse) return r } @@ -1774,3 +2444,23 @@ func allSnapshotsInTree(tree []types.VirtualMachineSnapshotTree) []types.Managed return result } + +func changeTrackingSupported(spec *types.VirtualMachineConfigSpec) bool { + for _, device := range spec.DeviceChange { + if dev, ok := device.GetVirtualDeviceConfigSpec().Device.(*types.VirtualDisk); ok { + switch dev.Backing.(type) { + case *types.VirtualDiskFlatVer2BackingInfo: + return true + case *types.VirtualDiskSparseVer2BackingInfo: + return true + case *types.VirtualDiskRawDiskMappingVer1BackingInfo: + return true + case *types.VirtualDiskRawDiskVer2BackingInfo: + return true + default: + return false + } + } + } + return false +} diff --git a/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager.go b/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager.go index c2df3cdb586..11ca6839de3 100644 --- a/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/vpx/performance_manager.go @@ -4436,7 +4436,7 @@ var PerfCounter = []types.PerfCounterInfo{ NameInfo: &types.ElementDescription{ Description: types.Description{ Label: "Net Throughput Contention", - Summary: "The aggregate network droppped packets for the host", + Summary: "The aggregate network dropped packets for the host", }, Key: "throughput.contention", }, @@ -7277,7 +7277,7 @@ var PerfCounter = []types.PerfCounterInfo{ Key: 251, NameInfo: &types.ElementDescription{ Description: types.Description{ - Label: "VXLAN Nework Found Matched ARP Entry Throughput", + Label: "VXLAN Network Found Matched ARP Entry Throughput", Summary: "Count of transmitted packets that found matched ARP entry for this network", }, Key: "throughput.vds.arpFound", @@ -10728,7 +10728,7 @@ var PerfCounter = []types.PerfCounterInfo{ Key: 370, NameInfo: &types.ElementDescription{ Description: types.Description{ - Label: "VXLAN Nework Found Matched ARP Entry Throughput", + Label: "VXLAN Network Found Matched ARP Entry Throughput", Summary: "Count of transmitted packets that found matched ARP entry for this network", }, Key: "throughput.vds.arpFound", diff --git a/vendor/github.com/vmware/govmomi/simulator/vpx/service_content.go b/vendor/github.com/vmware/govmomi/simulator/vpx/service_content.go index 90b93cc147e..3018d01ed27 100644 --- a/vendor/github.com/vmware/govmomi/simulator/vpx/service_content.go +++ b/vendor/github.com/vmware/govmomi/simulator/vpx/service_content.go @@ -16,7 +16,11 @@ limitations under the License. package vpx -import "github.com/vmware/govmomi/vim25/types" +import ( + "github.com/google/uuid" + + "github.com/vmware/govmomi/vim25/types" +) // ServiceContent is the default template for the ServiceInstance content property. // Capture method: @@ -37,7 +41,7 @@ var ServiceContent = types.ServiceContent{ ProductLineId: "vpx", ApiType: "VirtualCenter", ApiVersion: "6.5", - InstanceUuid: "dbed6e0c-bd88-4ef6-b594-21283e1c677f", + InstanceUuid: uuid.NewSHA1(uuid.NameSpaceOID, uuid.NodeID()).String(), LicenseProductName: "VMware VirtualCenter Server", LicenseProductVersion: "6.0", }, diff --git a/vendor/github.com/vmware/govmomi/simulator/vpx/task_manager.go b/vendor/github.com/vmware/govmomi/simulator/vpx/task_manager.go index 37b92228455..dee36ff71a1 100644 --- a/vendor/github.com/vmware/govmomi/simulator/vpx/task_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/vpx/task_manager.go @@ -1055,7 +1055,7 @@ var Description = types.TaskDescription{ &types.ElementDescription{ Description: types.Description{ Label: "Query feature capabilities for vSphere Distributed Switch specification", - Summary: "Queries feature capabilites available for a given vSphere Distributed Switch specification", + Summary: "Queries feature capabilities available for a given vSphere Distributed Switch specification", }, Key: "dvs.DistributedVirtualSwitchManager.queryFeatureCapability", }, @@ -7040,7 +7040,7 @@ var Description = types.TaskDescription{ &types.ElementDescription{ Description: types.Description{ Label: "Retrieve Managed Method Executer", - Summary: "Retrieves a referemce to Managed Method Executer", + Summary: "Retrieves a reference to Managed Method Executer", }, Key: "HostSystem.retrieveManagedMethodExecuter", }, @@ -10876,7 +10876,7 @@ var Description = types.TaskDescription{ &types.ElementDescription{ Description: types.Description{ Label: "Convert to a stretched cluster", - Summary: "Convert the given configuration to a streched cluster", + Summary: "Convert the given configuration to a stretched cluster", }, Key: "com.vmware.vsan.stretchedcluster.tasks.convert2stretchedcluster", }, @@ -10988,14 +10988,14 @@ var Description = types.TaskDescription{ &types.ElementDescription{ Description: types.Description{ Label: "Detect Update Manager Guest Agent", - Summary: "Detect Update Manager Guest Agent installataion on Linux VMs", + Summary: "Detect Update Manager Guest Agent installation on Linux VMs", }, Key: "com.vmware.vcIntegrity.DetectLinuxGATask", }, &types.ElementDescription{ Description: types.Description{ Label: "Cancel detecting Update Manager GuestAgent", - Summary: "Cancel detecting Update Manager GuestAgent installataion on Linux VMs", + Summary: "Cancel detecting Update Manager GuestAgent installation on Linux VMs", }, Key: "com.vmware.vcIntegrity.CancelDetectLinuxGATask", }, diff --git a/vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go b/vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go index d5fff8f4fa1..5dc138e0179 100644 --- a/vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go +++ b/vendor/github.com/vmware/govmomi/simulator/vstorage_object_manager.go @@ -17,6 +17,7 @@ limitations under the License. package simulator import ( + "log" "net/url" "os" "path/filepath" @@ -24,6 +25,7 @@ import ( "time" "github.com/google/uuid" + "github.com/vmware/govmomi/object" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/mo" @@ -42,11 +44,8 @@ type VcenterVStorageObjectManager struct { objects map[types.ManagedObjectReference]map[types.ID]*VStorageObject } -func NewVcenterVStorageObjectManager(ref types.ManagedObjectReference) object.Reference { - m := &VcenterVStorageObjectManager{} - m.Self = ref +func (m *VcenterVStorageObjectManager) init(*Registry) { m.objects = make(map[types.ManagedObjectReference]map[types.ID]*VStorageObject) - return m } func (m *VcenterVStorageObjectManager) object(ds types.ManagedObjectReference, id types.ID) *VStorageObject { @@ -70,13 +69,18 @@ func (m *VcenterVStorageObjectManager) ListVStorageObject(req *types.ListVStorag return body } -func (m *VcenterVStorageObjectManager) RetrieveVStorageObject(req *types.RetrieveVStorageObject) soap.HasFault { +func (m *VcenterVStorageObjectManager) RetrieveVStorageObject(ctx *Context, req *types.RetrieveVStorageObject) soap.HasFault { body := new(methods.RetrieveVStorageObjectBody) obj := m.object(req.Datastore, req.Id) if obj == nil { - body.Fault_ = Fault("", new(types.InvalidArgument)) + body.Fault_ = Fault("", new(types.NotFound)) } else { + stat := m.statDatastoreBacking(ctx, req.Datastore, &req.Id) + if err := stat[req.Id]; err != nil { + body.Fault_ = Fault(err.Error(), new(types.NotFound)) + return body + } body.Res = &types.RetrieveVStorageObjectResponse{ Returnval: obj.VStorageObject, } @@ -85,6 +89,51 @@ func (m *VcenterVStorageObjectManager) RetrieveVStorageObject(req *types.Retriev return body } +// statDatastoreBacking checks if object(s) backing file exists on the given datastore ref. +func (m *VcenterVStorageObjectManager) statDatastoreBacking(ctx *Context, ref types.ManagedObjectReference, id *types.ID) map[types.ID]error { + objs := m.objects[ref] // default to checking all objects + if id != nil { + // check for a specific object + objs = map[types.ID]*VStorageObject{ + *id: objs[*id], + } + } + res := make(map[types.ID]error, len(objs)) + ds := ctx.Map.Get(ref).(*Datastore) + dc := ctx.Map.getEntityDatacenter(ds) + fm := ctx.Map.FileManager() + + for _, obj := range objs { + backing := obj.Config.Backing.(*types.BaseConfigInfoDiskFileBackingInfo) + file, _ := fm.resolve(&dc.Self, backing.FilePath) + _, res[obj.Config.Id] = os.Stat(file) + } + + return res +} + +func (m *VcenterVStorageObjectManager) ReconcileDatastoreInventoryTask(ctx *Context, req *types.ReconcileDatastoreInventory_Task) soap.HasFault { + task := CreateTask(m, "reconcileDatastoreInventory", func(*Task) (types.AnyType, types.BaseMethodFault) { + objs := m.objects[req.Datastore] + stat := m.statDatastoreBacking(ctx, req.Datastore, nil) + + for id, err := range stat { + if os.IsNotExist(err) { + log.Printf("removing disk %s from inventory: %s", id.Id, err) + delete(objs, id) + } + } + + return nil, nil + }) + + return &methods.ReconcileDatastoreInventory_TaskBody{ + Res: &types.ReconcileDatastoreInventory_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + func (m *VcenterVStorageObjectManager) RegisterDisk(ctx *Context, req *types.RegisterDisk) soap.HasFault { body := new(methods.RegisterDiskBody) @@ -116,7 +165,7 @@ func (m *VcenterVStorageObjectManager) RegisterDisk(ctx *Context, req *types.Reg path := (&object.DatastorePath{Datastore: ds.Name, Path: u.Path}).String() for _, obj := range m.objects[ds.Self] { - backing := obj.Config.BaseConfigInfo.Backing.(*types.BaseConfigInfoDiskFileBackingInfo) + backing := obj.Config.Backing.(*types.BaseConfigInfoDiskFileBackingInfo) if backing.FilePath == path { return invalid() } @@ -152,13 +201,12 @@ func (m *VcenterVStorageObjectManager) createObject(req *types.CreateDisk_Task, ref := req.Spec.BackingSpec.GetVslmCreateSpecBackingSpec().Datastore ds := Map.Get(ref).(*Datastore) dc := Map.getEntityDatacenter(ds) - dm := Map.VirtualDiskManager() objects, ok := m.objects[ds.Self] if !ok { objects = make(map[types.ID]*VStorageObject) m.objects[ds.Self] = objects - _ = os.Mkdir(filepath.Join(ds.Info.GetDatastoreInfo().Url, dir), 0755) + _ = os.Mkdir(filepath.Join(ds.Info.GetDatastoreInfo().Url, dir), 0750) } id := uuid.New().String() @@ -191,8 +239,8 @@ func (m *VcenterVStorageObjectManager) createObject(req *types.CreateDisk_Task, path.Path = dir + "/" + id + ".vmdk" } - if register == false { - err := dm.createVirtualDisk(types.VirtualDeviceConfigSpecFileOperationCreate, &types.CreateVirtualDisk_Task{ + if !register { + err := vdmCreateVirtualDisk(types.VirtualDeviceConfigSpecFileOperationCreate, &types.CreateVirtualDisk_Task{ Datacenter: &dc.Self, Name: path.String(), }) @@ -201,7 +249,7 @@ func (m *VcenterVStorageObjectManager) createObject(req *types.CreateDisk_Task, } } - obj.Config.BaseConfigInfo.Backing = &types.BaseConfigInfoDiskFileBackingInfo{ + obj.Config.Backing = &types.BaseConfigInfoDiskFileBackingInfo{ BaseConfigInfoFileBackingInfo: types.BaseConfigInfoFileBackingInfo{ BaseConfigInfoBackingInfo: types.BaseConfigInfoBackingInfo{ Datastore: ds.Self, @@ -220,19 +268,19 @@ func (m *VcenterVStorageObjectManager) createObject(req *types.CreateDisk_Task, } -func (m *VcenterVStorageObjectManager) CreateDiskTask(req *types.CreateDisk_Task) soap.HasFault { +func (m *VcenterVStorageObjectManager) CreateDiskTask(ctx *Context, req *types.CreateDisk_Task) soap.HasFault { task := CreateTask(m, "createDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { return m.createObject(req, false) }) return &methods.CreateDisk_TaskBody{ Res: &types.CreateDisk_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (m *VcenterVStorageObjectManager) DeleteVStorageObjectTask(req *types.DeleteVStorageObject_Task) soap.HasFault { +func (m *VcenterVStorageObjectManager) DeleteVStorageObjectTask(ctx *Context, req *types.DeleteVStorageObject_Task) soap.HasFault { task := CreateTask(m, "deleteDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { obj := m.object(req.Datastore, req.Id) if obj == nil { @@ -240,10 +288,10 @@ func (m *VcenterVStorageObjectManager) DeleteVStorageObjectTask(req *types.Delet } backing := obj.Config.Backing.(*types.BaseConfigInfoDiskFileBackingInfo) - ds := Map.Get(req.Datastore).(*Datastore) - dc := Map.getEntityDatacenter(ds) - dm := Map.VirtualDiskManager() - dm.DeleteVirtualDiskTask(&types.DeleteVirtualDisk_Task{ + ds := ctx.Map.Get(req.Datastore).(*Datastore) + dc := ctx.Map.getEntityDatacenter(ds) + dm := ctx.Map.VirtualDiskManager() + dm.DeleteVirtualDiskTask(ctx, &types.DeleteVirtualDisk_Task{ Name: backing.FilePath, Datacenter: &dc.Self, }) @@ -255,7 +303,7 @@ func (m *VcenterVStorageObjectManager) DeleteVStorageObjectTask(req *types.Delet return &methods.DeleteVStorageObject_TaskBody{ Res: &types.DeleteVStorageObject_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } @@ -275,7 +323,7 @@ func (m *VcenterVStorageObjectManager) RetrieveSnapshotInfo(req *types.RetrieveS return body } -func (m *VcenterVStorageObjectManager) VStorageObjectCreateSnapshotTask(req *types.VStorageObjectCreateSnapshot_Task) soap.HasFault { +func (m *VcenterVStorageObjectManager) VStorageObjectCreateSnapshotTask(ctx *Context, req *types.VStorageObjectCreateSnapshot_Task) soap.HasFault { task := CreateTask(m, "createSnapshot", func(*Task) (types.AnyType, types.BaseMethodFault) { obj := m.object(req.Datastore, req.Id) if obj == nil { @@ -297,12 +345,29 @@ func (m *VcenterVStorageObjectManager) VStorageObjectCreateSnapshotTask(req *typ return &methods.VStorageObjectCreateSnapshot_TaskBody{ Res: &types.VStorageObjectCreateSnapshot_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } -func (m *VcenterVStorageObjectManager) DeleteSnapshotTask(req *types.DeleteSnapshot_Task) soap.HasFault { +func (m *VcenterVStorageObjectManager) ExtendDiskTask(ctx *Context, req *types.ExtendDisk_Task) soap.HasFault { + task := CreateTask(m, "extendDisk", func(*Task) (types.AnyType, types.BaseMethodFault) { + obj := m.object(req.Datastore, req.Id) + if obj == nil { + return nil, new(types.InvalidArgument) + } + + obj.Config.CapacityInMB = req.NewCapacityInMB + return nil, nil + }) + return &methods.ExtendDisk_TaskBody{ + Res: &types.ExtendDisk_TaskResponse{ + Returnval: task.Run(ctx), + }, + } +} + +func (m *VcenterVStorageObjectManager) DeleteSnapshotTask(ctx *Context, req *types.DeleteSnapshot_Task) soap.HasFault { task := CreateTask(m, "deleteSnapshot", func(*Task) (types.AnyType, types.BaseMethodFault) { obj := m.object(req.Datastore, req.Id) if obj != nil { @@ -318,7 +383,7 @@ func (m *VcenterVStorageObjectManager) DeleteSnapshotTask(req *types.DeleteSnaps return &methods.DeleteSnapshot_TaskBody{ Res: &types.DeleteSnapshot_TaskResponse{ - Returnval: task.Run(), + Returnval: task.Run(ctx), }, } } diff --git a/vendor/github.com/vmware/govmomi/sts/client.go b/vendor/github.com/vmware/govmomi/sts/client.go index 70e02de0939..d98c560954a 100644 --- a/vendor/github.com/vmware/govmomi/sts/client.go +++ b/vendor/github.com/vmware/govmomi/sts/client.go @@ -38,6 +38,8 @@ const ( // Client is a soap.Client targeting the STS (Secure Token Service) API endpoint. type Client struct { *soap.Client + + RoundTripper soap.RoundTripper } // NewClient returns a client targeting the STS API endpoint. @@ -48,7 +50,7 @@ func NewClient(ctx context.Context, c *vim25.Client) (*Client, error) { filter := &types.LookupServiceRegistrationFilter{ ServiceType: &types.LookupServiceRegistrationServiceType{ Product: "com.vmware.cis", - Type: "sso:sts", + Type: "cs.identity", }, EndpointType: &types.LookupServiceRegistrationEndpointType{ Protocol: "wsTrust", @@ -59,11 +61,19 @@ func NewClient(ctx context.Context, c *vim25.Client) (*Client, error) { url := lookup.EndpointURL(ctx, c, Path, filter) sc := c.Client.NewServiceClient(url, Namespace) - return &Client{sc}, nil + return &Client{sc, 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) } // TokenRequest parameters for issuing a SAML token. // At least one of Userinfo or Certificate must be specified. +// When `TokenRequest.Certificate` is set, the `tls.Certificate.PrivateKey` field must be set as it is required to sign the request. +// When the `tls.Certificate.Certificate` field is not set, the request Assertion header is set to that of the TokenRequest.Token. +// Otherwise `tls.Certificate.Certificate` is used as the BinarySecurityToken in the request. type TokenRequest struct { Userinfo *url.Userinfo // Userinfo when set issues a Bearer token Certificate *tls.Certificate // Certificate when set issues a HoK token diff --git a/vendor/github.com/vmware/govmomi/sts/internal/types.go b/vendor/github.com/vmware/govmomi/sts/internal/types.go index dc8402b018f..875dbe50538 100644 --- a/vendor/github.com/vmware/govmomi/sts/internal/types.go +++ b/vendor/github.com/vmware/govmomi/sts/internal/types.go @@ -473,12 +473,12 @@ func (a *AttributeStatement) C14N() string { type AttributeValue struct { XMLName xml.Name - Type string `xml:"type,attr"` + Type string `xml:"type,attr,typeattr"` Value string `xml:",innerxml"` } func (a *AttributeValue) C14N() string { - return fmt.Sprintf(`%s`, XSI, a.Value) + return fmt.Sprintf(`%s`, XSI, a.Type, a.Value) } type Attribute struct { @@ -682,7 +682,7 @@ func Marshal(val interface{}) string { // Note that the namespace is required when encoding, but the namespace prefix must not be // present when decoding as Go's decoding does not handle namespace prefix. func mkns(ns string, obj interface{}, name ...*xml.Name) string { - ns = ns + ":" + ns += ":" for i := range name { name[i].Space = "" if !strings.HasPrefix(name[i].Local, ns) { diff --git a/vendor/github.com/vmware/govmomi/sts/signer.go b/vendor/github.com/vmware/govmomi/sts/signer.go index 6a3b042bce8..6ee0ffdebd0 100644 --- a/vendor/github.com/vmware/govmomi/sts/signer.go +++ b/vendor/github.com/vmware/govmomi/sts/signer.go @@ -30,12 +30,14 @@ import ( "io" "io/ioutil" mrand "math/rand" + "net" "net/http" "net/url" "strings" "time" "github.com/google/uuid" + "github.com/vmware/govmomi/sts/internal" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/soap" @@ -126,22 +128,32 @@ func (s *Signer) Sign(env soap.Envelope) ([]byte, error) { req := x.RequestSecurityToken() c14n = req.C14N() body = req.String() - id := newID() - info.SecurityTokenReference = &internal.SecurityTokenReference{ - Reference: &internal.SecurityReference{ - URI: "#" + id, - ValueType: "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3", - }, - } + if len(s.Certificate.Certificate) == 0 { + header.Assertion = s.Token + if err := s.setTokenReference(&info); err != nil { + return nil, err + } + } else { + id := newID() - header.BinarySecurityToken = &internal.BinarySecurityToken{ - EncodingType: "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary", - ValueType: "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3", - ID: id, - Value: base64.StdEncoding.EncodeToString(s.Certificate.Certificate[0]), + header.BinarySecurityToken = &internal.BinarySecurityToken{ + EncodingType: "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary", + ValueType: "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3", + ID: id, + Value: base64.StdEncoding.EncodeToString(s.Certificate.Certificate[0]), + } + + info.SecurityTokenReference = &internal.SecurityTokenReference{ + Reference: &internal.SecurityReference{ + URI: "#" + id, + ValueType: "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3", + }, + } } - } else { + } + // When requesting HoK token for interactive user, request will have both priv. key and username/password. + if s.user.Username() != "" { header.UsernameToken = &internal.UsernameToken{ Username: s.user.Username(), } @@ -263,7 +275,7 @@ func (s *Signer) SignRequest(req *http.Request) error { return fmt.Errorf("sts: reading http.Request body: %s", rerr) } } - bhash := sha256.New().Sum(body) + bhash := sha256.Sum256(body) port := req.URL.Port() if port == "" { @@ -271,18 +283,25 @@ func (s *Signer) SignRequest(req *http.Request) error { } var buf bytes.Buffer + host := req.URL.Hostname() + + // Check if the host IP is in IPv6 format. If yes, add the opening and closing square brackets. + if isIPv6(host) { + host = fmt.Sprintf("%s%s%s", "[", host, "]") + } + msg := []string{ nonce, req.Method, req.URL.Path, - strings.ToLower(req.URL.Hostname()), + strings.ToLower(host), port, } for i := range msg { buf.WriteString(msg[i]) buf.WriteByte('\n') } - buf.Write(bhash) + buf.Write(bhash[:]) buf.WriteByte('\n') sum := sha256.Sum256(buf.Bytes()) @@ -309,7 +328,7 @@ func (s *Signer) SignRequest(req *http.Request) error { }) add(param{ key: "bodyhash", - val: base64.StdEncoding.EncodeToString(bhash), + val: base64.StdEncoding.EncodeToString(bhash[:]), }) } @@ -326,3 +345,11 @@ func (s *Signer) NewRequest() TokenRequest { KeyID: s.keyID, } } + +func isIPv6(s string) bool { + ip := net.ParseIP(s) + if ip == nil { + return false + } + return ip.To4() == nil +} diff --git a/vendor/github.com/vmware/govmomi/sts/simulator/simulator.go b/vendor/github.com/vmware/govmomi/sts/simulator/simulator.go index 5ed2d075516..be65f14f28f 100644 --- a/vendor/github.com/vmware/govmomi/sts/simulator/simulator.go +++ b/vendor/github.com/vmware/govmomi/sts/simulator/simulator.go @@ -22,13 +22,24 @@ import ( "net/http" "net/url" "path" + "strings" "time" + "github.com/vmware/govmomi/simulator" "github.com/vmware/govmomi/sts/internal" "github.com/vmware/govmomi/vim25/soap" vim "github.com/vmware/govmomi/vim25/types" ) +func init() { + simulator.RegisterEndpoint(func(s *simulator.Service, r *simulator.Registry) { + if r.IsVPX() { + path, handler := New(s.Listen, r.OptionManager().Setting) + s.Handle(path, handler) + } + }) +} + // New creates an STS simulator and configures the simulator endpoint in the given settings. // The path returned is that of the settings "config.vpxd.sso.sts.uri" property. func New(u *url.URL, settings []vim.BaseOptionValue) (string, http.Handler) { @@ -36,9 +47,6 @@ func New(u *url.URL, settings []vim.BaseOptionValue) (string, http.Handler) { setting := settings[i].GetOptionValue() if setting.Key == "config.vpxd.sso.sts.uri" { endpoint, _ := url.Parse(setting.Value.(string)) - endpoint.Host = u.Host - setting.Value = endpoint.String() - settings[i] = setting return endpoint.Path, new(handler) } } @@ -50,6 +58,8 @@ type handler struct{} // ServeHTTP handles STS requests. func (s *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { action := r.Header.Get("SOAPAction") + action = strings.TrimSuffix(action, `"`) // PowerCLI sts client quotes the header value + env := soap.Envelope{} now := time.Now() lifetime := &internal.Lifetime{ diff --git a/vendor/github.com/vmware/govmomi/task/error.go b/vendor/github.com/vmware/govmomi/task/error.go index 5f6b8503f5b..3fff5aa2658 100644 --- a/vendor/github.com/vmware/govmomi/task/error.go +++ b/vendor/github.com/vmware/govmomi/task/error.go @@ -20,6 +20,7 @@ import "github.com/vmware/govmomi/vim25/types" type Error struct { *types.LocalizedMethodFault + Description *types.LocalizableMessage } // Error returns the task's localized fault message. diff --git a/vendor/github.com/vmware/govmomi/task/history_collector.go b/vendor/github.com/vmware/govmomi/task/history_collector.go new file mode 100644 index 00000000000..7d8a6cf04ab --- /dev/null +++ b/vendor/github.com/vmware/govmomi/task/history_collector.go @@ -0,0 +1,89 @@ +/* +Copyright (c) 2015-2022 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package task + +import ( + "context" + + "github.com/vmware/govmomi/history" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +// HistoryCollector provides a mechanism for retrieving historical data and +// updates when the server appends new tasks. +type HistoryCollector struct { + *history.Collector +} + +func newHistoryCollector(c *vim25.Client, ref types.ManagedObjectReference) *HistoryCollector { + return &HistoryCollector{ + Collector: history.NewCollector(c, ref), + } +} + +// LatestPage returns items in the 'viewable latest page' of the task history collector. +// As new tasks that match the collector's TaskFilterSpec are created, +// they are added to this page, and the oldest tasks are removed from the collector to keep +// the size of the page to that allowed by SetCollectorPageSize. +// The "oldest task" is the one with the oldest creation time. The tasks in the returned page are unordered. +func (h HistoryCollector) LatestPage(ctx context.Context) ([]types.TaskInfo, error) { + var o mo.TaskHistoryCollector + + err := h.Properties(ctx, h.Reference(), []string{"latestPage"}, &o) + if err != nil { + return nil, err + } + + return o.LatestPage, nil +} + +// ReadNextTasks reads the scrollable view from the current position. The +// scrollable position is moved to the next newer page after the read. No item +// is returned when the end of the collector is reached. +func (h HistoryCollector) ReadNextTasks(ctx context.Context, maxCount int32) ([]types.TaskInfo, error) { + req := types.ReadNextTasks{ + This: h.Reference(), + MaxCount: maxCount, + } + + res, err := methods.ReadNextTasks(ctx, h.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} + +// ReadPreviousTasks reads the scrollable view from the current position. The +// scrollable position is then moved to the next older page after the read. No +// item is returned when the head of the collector is reached. +func (h HistoryCollector) ReadPreviousTasks(ctx context.Context, maxCount int32) ([]types.TaskInfo, error) { + req := types.ReadPreviousTasks{ + This: h.Reference(), + MaxCount: maxCount, + } + + res, err := methods.ReadPreviousTasks(ctx, h.Client(), &req) + if err != nil { + return nil, err + } + + return res.Returnval, nil +} diff --git a/vendor/github.com/vmware/govmomi/task/manager.go b/vendor/github.com/vmware/govmomi/task/manager.go new file mode 100644 index 00000000000..8279089d7db --- /dev/null +++ b/vendor/github.com/vmware/govmomi/task/manager.go @@ -0,0 +1,61 @@ +/* +Copyright (c) 2014-2022 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package task + +import ( + "context" + + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" +) + +type Manager struct { + r types.ManagedObjectReference + c *vim25.Client +} + +// NewManager creates a new task manager +func NewManager(c *vim25.Client) *Manager { + m := Manager{ + r: *c.ServiceContent.TaskManager, + c: c, + } + + return &m +} + +// Reference returns the task.Manager MOID +func (m Manager) Reference() types.ManagedObjectReference { + return m.r +} + +// CreateCollectorForTasks returns a task history collector, a specialized +// history collector that gathers TaskInfo data objects. +func (m Manager) CreateCollectorForTasks(ctx context.Context, filter types.TaskFilterSpec) (*HistoryCollector, error) { + req := types.CreateCollectorForTasks{ + This: m.r, + Filter: filter, + } + + res, err := methods.CreateCollectorForTasks(ctx, m.c, &req) + if err != nil { + return nil, err + } + + return newHistoryCollector(m.c, res.Returnval), nil +} diff --git a/vendor/github.com/vmware/govmomi/task/wait.go b/vendor/github.com/vmware/govmomi/task/wait.go index 19fee538463..b78f5110d95 100644 --- a/vendor/github.com/vmware/govmomi/task/wait.go +++ b/vendor/github.com/vmware/govmomi/task/wait.go @@ -38,7 +38,7 @@ func (t taskProgress) Detail() string { func (t taskProgress) Error() error { if t.info.Error != nil { - return Error{t.info.Error} + return Error{t.info.Error, t.info.Description} } return nil @@ -68,7 +68,7 @@ func (t *taskCallback) fn(pc []types.PropertyChange) bool { t.info = &ti } - // t.info could be nil if pc can't satify the rules above + // t.info could be nil if pc can't satisfy the rules above if t.info == nil { return false } @@ -123,7 +123,18 @@ func Wait(ctx context.Context, ref types.ManagedObjectReference, pc *property.Co defer close(cb.ch) } - err := property.Wait(ctx, pc, ref, []string{"info"}, cb.fn) + filter := &property.WaitFilter{PropagateMissing: true} + filter.Add(ref, ref.Type, []string{"info"}) + + err := property.WaitForUpdates(ctx, pc, filter, func(updates []types.ObjectUpdate) bool { + for _, update := range updates { + if cb.fn(update.ChangeSet) { + return true + } + } + + return false + }) if err != nil { return nil, err } diff --git a/vendor/github.com/vmware/govmomi/toolbox/hgfs/archive.go b/vendor/github.com/vmware/govmomi/toolbox/hgfs/archive.go new file mode 100644 index 00000000000..65f5743aba9 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/toolbox/hgfs/archive.go @@ -0,0 +1,342 @@ +/* +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 hgfs + +import ( + "archive/tar" + "bufio" + "bytes" + "compress/gzip" + "io" + "io/ioutil" + "log" + "math" + "net/url" + "os" + "path/filepath" + "strings" + "sync" + "time" + + "github.com/vmware/govmomi/toolbox/vix" +) + +// ArchiveScheme is the default scheme used to register the archive FileHandler +var ArchiveScheme = "archive" + +// ArchiveHandler implements a FileHandler for transferring directories. +type ArchiveHandler struct { + Read func(*url.URL, *tar.Reader) error + Write func(*url.URL, *tar.Writer) error +} + +// NewArchiveHandler returns a FileHandler implementation for transferring directories using gzip'd tar files. +func NewArchiveHandler() FileHandler { + return &ArchiveHandler{ + Read: archiveRead, + Write: archiveWrite, + } +} + +// Stat implements FileHandler.Stat +func (*ArchiveHandler) Stat(u *url.URL) (os.FileInfo, error) { + switch u.Query().Get("format") { + case "", "tar", "tgz": + // ok + default: + log.Printf("unknown archive format: %q", u) + return nil, vix.Error(vix.InvalidArg) + } + + return &archive{ + name: u.Path, + size: math.MaxInt64, + }, nil +} + +// Open implements FileHandler.Open +func (h *ArchiveHandler) Open(u *url.URL, mode int32) (File, error) { + switch mode { + case OpenModeReadOnly: + return h.newArchiveFromGuest(u) + case OpenModeWriteOnly: + return h.newArchiveToGuest(u) + default: + return nil, os.ErrNotExist + } +} + +// archive implements the hgfs.File and os.FileInfo interfaces. +type archive struct { + name string + size int64 + done func() error + + io.Reader + io.Writer +} + +// Name implementation of the os.FileInfo interface method. +func (a *archive) Name() string { + return a.name +} + +// Size implementation of the os.FileInfo interface method. +func (a *archive) Size() int64 { + return a.size +} + +// Mode implementation of the os.FileInfo interface method. +func (a *archive) Mode() os.FileMode { + return 0600 +} + +// ModTime implementation of the os.FileInfo interface method. +func (a *archive) ModTime() time.Time { + return time.Now() +} + +// IsDir implementation of the os.FileInfo interface method. +func (a *archive) IsDir() bool { + return false +} + +// Sys implementation of the os.FileInfo interface method. +func (a *archive) Sys() interface{} { + return nil +} + +// The trailer is required since TransferFromGuest requires a Content-Length, +// which toolbox doesn't know ahead of time as the gzip'd tarball never touches the disk. +// HTTP clients need to be aware of this and stop reading when they see the 2nd gzip header. +var gzipHeader = []byte{0x1f, 0x8b, 0x08} // rfc1952 {ID1, ID2, CM} + +var gzipTrailer = true + +// newArchiveFromGuest returns an hgfs.File implementation to read a directory as a gzip'd tar. +func (h *ArchiveHandler) newArchiveFromGuest(u *url.URL) (File, error) { + r, w := io.Pipe() + + a := &archive{ + name: u.Path, + done: r.Close, + Reader: r, + Writer: w, + } + + var z io.Writer = w + var c io.Closer = ioutil.NopCloser(nil) + + switch u.Query().Get("format") { + case "tgz": + gz := gzip.NewWriter(w) + z = gz + c = gz + } + + tw := tar.NewWriter(z) + + go func() { + err := h.Write(u, tw) + + _ = tw.Close() + _ = c.Close() + if gzipTrailer { + _, _ = w.Write(gzipHeader) + } + _ = w.CloseWithError(err) + }() + + return a, nil +} + +// newArchiveToGuest returns an hgfs.File implementation to expand a gzip'd tar into a directory. +func (h *ArchiveHandler) newArchiveToGuest(u *url.URL) (File, error) { + r, w := io.Pipe() + + buf := bufio.NewReader(r) + + a := &archive{ + name: u.Path, + Reader: buf, + Writer: w, + } + + var cerr error + var wg sync.WaitGroup + + a.done = func() error { + _ = w.Close() + // We need to wait for unpack to finish to complete its work + // and to propagate the error if any to Close. + wg.Wait() + return cerr + } + + wg.Add(1) + go func() { + defer wg.Done() + + c := func() error { + // Drain the pipe of tar trailer data (two null blocks) + if cerr == nil { + _, _ = io.Copy(ioutil.Discard, a.Reader) + } + return nil + } + + header, _ := buf.Peek(len(gzipHeader)) + + if bytes.Equal(header, gzipHeader) { + gz, err := gzip.NewReader(a.Reader) + if err != nil { + _ = r.CloseWithError(err) + cerr = err + return + } + + c = gz.Close + a.Reader = gz + } + + tr := tar.NewReader(a.Reader) + + cerr = h.Read(u, tr) + + _ = c() + _ = r.CloseWithError(cerr) + }() + + return a, nil +} + +func (a *archive) Close() error { + return a.done() +} + +// archiveRead writes the contents of the given tar.Reader to the given directory. +func archiveRead(u *url.URL, tr *tar.Reader) error { + for { + header, err := tr.Next() + if err != nil { + if err == io.EOF { + return nil + } + return err + } + + name := filepath.Join(u.Path, header.Name) + mode := os.FileMode(header.Mode) + + switch header.Typeflag { + case tar.TypeDir: + err = os.MkdirAll(name, mode) + case tar.TypeReg: + _ = os.MkdirAll(filepath.Dir(name), 0750) + + var f *os.File + + f, err = os.OpenFile(name, os.O_CREATE|os.O_RDWR|os.O_TRUNC, mode) + if err == nil { + _, cerr := io.Copy(f, tr) + err = f.Close() + if cerr != nil { + err = cerr + } + } + case tar.TypeSymlink: + err = os.Symlink(header.Linkname, name) + } + + // TODO: Uid/Gid may not be meaningful here without some mapping. + // The other option to consider would be making use of the guest auth user ID. + // os.Lchown(name, header.Uid, header.Gid) + + if err != nil { + return err + } + } +} + +// archiveWrite writes the contents of the given source directory to the given tar.Writer. +func archiveWrite(u *url.URL, tw *tar.Writer) error { + info, err := os.Stat(u.Path) + if err != nil { + return err + } + + // Note that the VMX will trim any trailing slash. For example: + // "/foo/bar/?prefix=bar/" will end up here as "/foo/bar/?prefix=bar" + // Escape to avoid this: "/for/bar/?prefix=bar%2F" + prefix := u.Query().Get("prefix") + + dir := u.Path + + f := func(file string, fi os.FileInfo, err error) error { + if err != nil { + return filepath.SkipDir + } + + name := strings.TrimPrefix(file, dir) + name = strings.TrimPrefix(name, "/") + + if name == "" { + return nil // this is u.Path itself (which may or may not have a trailing "/") + } + + if prefix != "" { + name = prefix + name + } + + header, _ := tar.FileInfoHeader(fi, name) + + header.Name = name + + if header.Typeflag == tar.TypeDir { + header.Name += "/" + } + + var f *os.File + + if header.Typeflag == tar.TypeReg && fi.Size() != 0 { + f, err = os.Open(filepath.Clean(file)) + if err != nil { + if os.IsPermission(err) { + return nil + } + return err + } + } + + _ = tw.WriteHeader(header) + + if f != nil { + _, err = io.Copy(tw, f) + _ = f.Close() + } + + return err + } + + if info.IsDir() { + return filepath.Walk(u.Path, f) + } + + dir = filepath.Dir(dir) + + return f(u.Path, info, nil) +} diff --git a/vendor/github.com/vmware/govmomi/toolbox/hgfs/encoding.go b/vendor/github.com/vmware/govmomi/toolbox/hgfs/encoding.go new file mode 100644 index 00000000000..24f71f6c198 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/toolbox/hgfs/encoding.go @@ -0,0 +1,73 @@ +/* +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 hgfs + +import ( + "bytes" + "encoding" + "encoding/binary" +) + +// MarshalBinary is a wrapper around binary.Write +func MarshalBinary(fields ...interface{}) ([]byte, error) { + buf := new(bytes.Buffer) + + for _, p := range fields { + switch m := p.(type) { + case encoding.BinaryMarshaler: + data, err := m.MarshalBinary() + if err != nil { + return nil, ProtocolError(err) + } + + _, _ = buf.Write(data) + case []byte: + _, _ = buf.Write(m) + case string: + _, _ = buf.WriteString(m) + default: + err := binary.Write(buf, binary.LittleEndian, p) + if err != nil { + return nil, ProtocolError(err) + } + } + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary is a wrapper around binary.Read +func UnmarshalBinary(data []byte, fields ...interface{}) error { + buf := bytes.NewBuffer(data) + + for _, p := range fields { + switch m := p.(type) { + case encoding.BinaryUnmarshaler: + return m.UnmarshalBinary(buf.Bytes()) + case *[]byte: + *m = buf.Bytes() + return nil + default: + err := binary.Read(buf, binary.LittleEndian, p) + if err != nil { + return ProtocolError(err) + } + } + } + + return nil +} diff --git a/vendor/github.com/vmware/govmomi/toolbox/hgfs/hgfs_linux.go b/vendor/github.com/vmware/govmomi/toolbox/hgfs/hgfs_linux.go new file mode 100644 index 00000000000..16794ae5fe4 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/toolbox/hgfs/hgfs_linux.go @@ -0,0 +1,58 @@ +/* +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 hgfs + +import ( + "os" + "syscall" +) + +const attrMask = AttrValidAllocationSize | + AttrValidAccessTime | AttrValidWriteTime | AttrValidCreateTime | AttrValidChangeTime | + AttrValidSpecialPerms | AttrValidOwnerPerms | AttrValidGroupPerms | AttrValidOtherPerms | AttrValidEffectivePerms | + AttrValidUserID | AttrValidGroupID | AttrValidFileID | AttrValidVolID + +func (a *AttrV2) sysStat(info os.FileInfo) { + sys, ok := info.Sys().(*syscall.Stat_t) + + if !ok { + return + } + + a.AllocationSize = uint64(sys.Blocks * 512) + + nt := func(t syscall.Timespec) uint64 { + return uint64(t.Nano()) // TODO: this is supposed to be Windows NT system time, not needed atm + } + + a.AccessTime = nt(sys.Atim) + a.WriteTime = nt(sys.Mtim) + a.CreationTime = a.WriteTime // see HgfsGetCreationTime + a.AttrChangeTime = nt(sys.Ctim) + + a.SpecialPerms = uint8((sys.Mode & (syscall.S_ISUID | syscall.S_ISGID | syscall.S_ISVTX)) >> 9) + a.OwnerPerms = uint8((sys.Mode & syscall.S_IRWXU) >> 6) + a.GroupPerms = uint8((sys.Mode & syscall.S_IRWXG) >> 3) + a.OtherPerms = uint8(sys.Mode & syscall.S_IRWXO) + + a.UserID = sys.Uid + a.GroupID = sys.Gid + a.HostFileID = sys.Ino + a.VolumeID = uint32(sys.Dev) + + a.Mask |= attrMask +} diff --git a/vendor/github.com/vmware/govmomi/simulator/os_windows.go b/vendor/github.com/vmware/govmomi/toolbox/hgfs/hgfs_other.go similarity index 73% rename from vendor/github.com/vmware/govmomi/simulator/os_windows.go rename to vendor/github.com/vmware/govmomi/toolbox/hgfs/hgfs_other.go index 55cf2ab07ef..ba5d64af4f7 100644 --- a/vendor/github.com/vmware/govmomi/simulator/os_windows.go +++ b/vendor/github.com/vmware/govmomi/toolbox/hgfs/hgfs_other.go @@ -1,5 +1,8 @@ +//go:build !linux +// +build !linux + /* -Copyright (c) 2017 VMware, Inc. All Rights Reserved. +Copyright (c) 2017-2022 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,13 +17,11 @@ See the License for the specific language governing permissions and limitations under the License. */ -package simulator +package hgfs -import "os" +import ( + "os" +) -func (ds *Datastore) stat() error { - info := ds.Info.GetDatastoreInfo() - - _, err := os.Stat(info.Url) - return err +func (a *AttrV2) sysStat(info os.FileInfo) { } diff --git a/vendor/github.com/vmware/govmomi/toolbox/hgfs/protocol.go b/vendor/github.com/vmware/govmomi/toolbox/hgfs/protocol.go new file mode 100644 index 00000000000..a91a0269e62 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/toolbox/hgfs/protocol.go @@ -0,0 +1,847 @@ +/* +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 hgfs + +import ( + "bytes" + "encoding/binary" + "fmt" + "log" + "os" + "strings" +) + +// See: https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/lib/include/hgfsProto.h + +// Opcodes for server operations as defined in hgfsProto.h +const ( + OpOpen = iota /* Open file */ + OpRead /* Read from file */ + OpWrite /* Write to file */ + OpClose /* Close file */ + OpSearchOpen /* Start new search */ + OpSearchRead /* Get next search response */ + OpSearchClose /* End a search */ + OpGetattr /* Get file attributes */ + OpSetattr /* Set file attributes */ + OpCreateDir /* Create new directory */ + OpDeleteFile /* Delete a file */ + OpDeleteDir /* Delete a directory */ + OpRename /* Rename a file or directory */ + OpQueryVolumeInfo /* Query volume information */ + OpOpenV2 /* Open file */ + OpGetattrV2 /* Get file attributes */ + OpSetattrV2 /* Set file attributes */ + OpSearchReadV2 /* Get next search response */ + OpCreateSymlink /* Create a symlink */ + OpServerLockChange /* Change the oplock on a file */ + OpCreateDirV2 /* Create a directory */ + OpDeleteFileV2 /* Delete a file */ + OpDeleteDirV2 /* Delete a directory */ + OpRenameV2 /* Rename a file or directory */ + OpOpenV3 /* Open file */ + OpReadV3 /* Read from file */ + OpWriteV3 /* Write to file */ + OpCloseV3 /* Close file */ + OpSearchOpenV3 /* Start new search */ + OpSearchReadV3 /* Read V3 directory entries */ + OpSearchCloseV3 /* End a search */ + OpGetattrV3 /* Get file attributes */ + OpSetattrV3 /* Set file attributes */ + OpCreateDirV3 /* Create new directory */ + OpDeleteFileV3 /* Delete a file */ + OpDeleteDirV3 /* Delete a directory */ + OpRenameV3 /* Rename a file or directory */ + OpQueryVolumeInfoV3 /* Query volume information */ + OpCreateSymlinkV3 /* Create a symlink */ + OpServerLockChangeV3 /* Change the oplock on a file */ + OpWriteWin32StreamV3 /* Write WIN32_STREAM_ID format data to file */ + OpCreateSessionV4 /* Create a session and return host capabilities. */ + OpDestroySessionV4 /* Destroy/close session. */ + OpReadFastV4 /* Read */ + OpWriteFastV4 /* Write */ + OpSetWatchV4 /* Start monitoring directory changes. */ + OpRemoveWatchV4 /* Stop monitoring directory changes. */ + OpNotifyV4 /* Notification for a directory change event. */ + OpSearchReadV4 /* Read V4 directory entries. */ + OpOpenV4 /* Open file */ + OpEnumerateStreamsV4 /* Enumerate alternative named streams for a file. */ + OpGetattrV4 /* Get file attributes */ + OpSetattrV4 /* Set file attributes */ + OpDeleteV4 /* Delete a file or a directory */ + OpLinkmoveV4 /* Rename/move/create hard link. */ + OpFsctlV4 /* Sending FS control requests. */ + OpAccessCheckV4 /* Access check. */ + OpFsyncV4 /* Flush all cached data to the disk. */ + OpQueryVolumeInfoV4 /* Query volume information. */ + OpOplockAcquireV4 /* Acquire OPLOCK. */ + OpOplockBreakV4 /* Break or downgrade OPLOCK. */ + OpLockByteRangeV4 /* Acquire byte range lock. */ + OpUnlockByteRangeV4 /* Release byte range lock. */ + OpQueryEasV4 /* Query extended attributes. */ + OpSetEasV4 /* Add or modify extended attributes. */ + OpNewHeader = 0xff /* Header op, must be unique, distinguishes packet headers. */ +) + +// Status codes +const ( + StatusSuccess = iota + StatusNoSuchFileOrDir + StatusInvalidHandle + StatusOperationNotPermitted + StatusFileExists + StatusNotDirectory + StatusDirNotEmpty + StatusProtocolError + StatusAccessDenied + StatusInvalidName + StatusGenericError + StatusSharingViolation + StatusNoSpace + StatusOperationNotSupported + StatusNameTooLong + StatusInvalidParameter + StatusNotSameDevice + StatusStaleSession + StatusTooManySessions + StatusTransportError +) + +// Flags for attr mask +const ( + AttrValidType = 1 << iota + AttrValidSize + AttrValidCreateTime + AttrValidAccessTime + AttrValidWriteTime + AttrValidChangeTime + AttrValidSpecialPerms + AttrValidOwnerPerms + AttrValidGroupPerms + AttrValidOtherPerms + AttrValidFlags + AttrValidAllocationSize + AttrValidUserID + AttrValidGroupID + AttrValidFileID + AttrValidVolID + AttrValidNonStaticFileID + AttrValidEffectivePerms + AttrValidExtendAttrSize + AttrValidReparsePoint + AttrValidShortName +) + +// HeaderVersion for HGFS protocol version 4 +const HeaderVersion = 0x1 + +// LargePacketMax is maximum size of an hgfs packet +const LargePacketMax = 0xf800 // HGFS_LARGE_PACKET_MAX + +// Packet flags +const ( + PacketFlagRequest = 1 << iota + PacketFlagReply + PacketFlagInfoExterror + PacketFlagValidFlags = 0x7 +) + +// Status is an error type that encapsulates an error status code and the cause +type Status struct { + Err error + Code uint32 +} + +func (s *Status) Error() string { + if s.Err != nil { + return s.Err.Error() + } + + return fmt.Sprintf("hgfs.Status=%d", s.Code) +} + +// errorStatus maps the given error type to a status code +func errorStatus(err error) uint32 { + if x, ok := err.(*Status); ok { + return x.Code + } + + switch { + case os.IsNotExist(err): + return StatusNoSuchFileOrDir + case os.IsExist(err): + return StatusFileExists + case os.IsPermission(err): + return StatusOperationNotPermitted + } + + return StatusGenericError +} + +// ProtocolError wraps the given error as a Status type +func ProtocolError(err error) error { + return &Status{ + Err: err, + Code: StatusProtocolError, + } +} + +// Request as defined in hgfsProto.h:HgfsRequest +type Request struct { + Handle uint32 + Op int32 +} + +// Reply as defined in hgfsProto.h:HgfsReply +type Reply struct { + Handle uint32 + Status uint32 +} + +// Header as defined in hgfsProto.h:HgfsHeader +type Header struct { + Version uint8 + Reserved1 [3]uint8 + Dummy int32 + PacketSize uint32 + HeaderSize uint32 + RequestID uint32 + Op int32 + Status uint32 + Flags uint32 + Information uint32 + SessionID uint64 + Reserved uint64 +} + +var ( + headerSize = uint32(binary.Size(new(Header))) + + packetSize = func(r *Packet) uint32 { + return headerSize + uint32(len(r.Payload)) + } +) + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (h *Header) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, h) + if err != nil { + return fmt.Errorf("reading hgfs header: %s", err) + } + + if h.Dummy != OpNewHeader { + return fmt.Errorf("expected hgfs header with OpNewHeader (%#x), got: %#x", OpNewHeader, h.Dummy) + } + + return nil +} + +// Packet encapsulates an hgfs Header and Payload +type Packet struct { + Header + + Payload []byte +} + +// Reply composes a new Packet with the given payload or error +func (r *Packet) Reply(payload interface{}, err error) ([]byte, error) { + p := new(Packet) + + status := uint32(StatusSuccess) + + if err != nil { + status = errorStatus(err) + } else { + p.Payload, err = MarshalBinary(payload) + if err != nil { + return nil, err + } + } + + p.Header = Header{ + Version: HeaderVersion, + Dummy: OpNewHeader, + PacketSize: headerSize + uint32(len(p.Payload)), + HeaderSize: headerSize, + RequestID: r.RequestID, + Op: r.Op, + Status: status, + Flags: PacketFlagReply, + Information: 0, + SessionID: r.SessionID, + } + + if Trace { + rc := "OK" + if err != nil { + rc = err.Error() + } + fmt.Fprintf(os.Stderr, "[hgfs] response %#v [%s]\n", p.Header, rc) + } else if err != nil { + log.Printf("[hgfs] op=%d error: %s", r.Op, err) + } + + return p.MarshalBinary() +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *Packet) MarshalBinary() ([]byte, error) { + r.Header.PacketSize = packetSize(r) + + buf, _ := MarshalBinary(r.Header) + + return append(buf, r.Payload...), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *Packet) UnmarshalBinary(data []byte) error { + err := r.Header.UnmarshalBinary(data) + if err != nil { + return err + } + + r.Payload = data[r.HeaderSize:r.PacketSize] + + return nil +} + +// Capability as defined in hgfsProto.h:HgfsCapability +type Capability struct { + Op int32 + Flags uint32 +} + +// RequestCreateSessionV4 as defined in hgfsProto.h:HgfsRequestCreateSessionV4 +type RequestCreateSessionV4 struct { + NumCapabilities uint32 + MaxPacketSize uint32 + Flags uint32 + Reserved uint32 + Capabilities []Capability +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *RequestCreateSessionV4) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + r.NumCapabilities = uint32(len(r.Capabilities)) + + fields := []*uint32{ + &r.NumCapabilities, + &r.MaxPacketSize, + &r.Flags, + &r.Reserved, + } + + for _, p := range fields { + err := binary.Write(buf, binary.LittleEndian, p) + if err != nil { + return nil, err + } + } + + for i := uint32(0); i < r.NumCapabilities; i++ { + err := binary.Write(buf, binary.LittleEndian, &r.Capabilities[i]) + if err != nil { + return nil, err + } + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *RequestCreateSessionV4) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + fields := []*uint32{ + &r.NumCapabilities, + &r.MaxPacketSize, + &r.Flags, + &r.Reserved, + } + + for _, p := range fields { + err := binary.Read(buf, binary.LittleEndian, p) + if err != nil { + return err + } + } + + for i := uint32(0); i < r.NumCapabilities; i++ { + var cap Capability + err := binary.Read(buf, binary.LittleEndian, &cap) + if err != nil { + return err + } + + r.Capabilities = append(r.Capabilities, cap) + } + + return nil +} + +// ReplyCreateSessionV4 as defined in hgfsProto.h:HgfsReplyCreateSessionV4 +type ReplyCreateSessionV4 struct { + SessionID uint64 + NumCapabilities uint32 + MaxPacketSize uint32 + IdentityOffset uint32 + Flags uint32 + Reserved uint32 + Capabilities []Capability +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *ReplyCreateSessionV4) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + fields := []interface{}{ + &r.SessionID, + &r.NumCapabilities, + &r.MaxPacketSize, + &r.IdentityOffset, + &r.Flags, + &r.Reserved, + } + + for _, p := range fields { + err := binary.Write(buf, binary.LittleEndian, p) + if err != nil { + return nil, err + } + } + + for i := uint32(0); i < r.NumCapabilities; i++ { + err := binary.Write(buf, binary.LittleEndian, &r.Capabilities[i]) + if err != nil { + return nil, err + } + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *ReplyCreateSessionV4) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + fields := []interface{}{ + &r.SessionID, + &r.NumCapabilities, + &r.MaxPacketSize, + &r.IdentityOffset, + &r.Flags, + &r.Reserved, + } + + for _, p := range fields { + err := binary.Read(buf, binary.LittleEndian, p) + if err != nil { + return err + } + } + + for i := uint32(0); i < r.NumCapabilities; i++ { + var cap Capability + err := binary.Read(buf, binary.LittleEndian, &cap) + if err != nil { + return err + } + + r.Capabilities = append(r.Capabilities, cap) + } + + return nil +} + +// RequestDestroySessionV4 as defined in hgfsProto.h:HgfsRequestDestroySessionV4 +type RequestDestroySessionV4 struct { + Reserved uint64 +} + +// ReplyDestroySessionV4 as defined in hgfsProto.h:HgfsReplyDestroySessionV4 +type ReplyDestroySessionV4 struct { + Reserved uint64 +} + +// FileName as defined in hgfsProto.h:HgfsFileName +type FileName struct { + Length uint32 + Name string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (f *FileName) MarshalBinary() ([]byte, error) { + name := f.Name + f.Length = uint32(len(f.Name)) + if f.Length == 0 { + // field is defined as 'char name[1];', this byte is required for min sizeof() validation + name = "\x00" + } + return MarshalBinary(&f.Length, name) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (f *FileName) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + _ = binary.Read(buf, binary.LittleEndian, &f.Length) + + f.Name = string(buf.Next(int(f.Length))) + + return nil +} + +const serverPolicyRootShareName = "root" + +// FromString converts name to a FileName +func (f *FileName) FromString(name string) { + name = strings.TrimPrefix(name, "/") + + cp := strings.Split(name, "/") + + cp = append([]string{serverPolicyRootShareName}, cp...) + + f.Name = strings.Join(cp, "\x00") + f.Length = uint32(len(f.Name)) +} + +// Path converts FileName to a string +func (f *FileName) Path() string { + cp := strings.Split(f.Name, "\x00") + + if len(cp) == 0 || cp[0] != serverPolicyRootShareName { + return "" // TODO: not happening until if/when we handle Windows shares + } + + cp[0] = "" + + return strings.Join(cp, "/") +} + +// FileNameV3 as defined in hgfsProto.h:HgfsFileNameV3 +type FileNameV3 struct { + Length uint32 + Flags uint32 + CaseType int32 + ID uint32 + Name string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (f *FileNameV3) MarshalBinary() ([]byte, error) { + name := f.Name + f.Length = uint32(len(f.Name)) + if f.Length == 0 { + // field is defined as 'char name[1];', this byte is required for min sizeof() validation + name = "\x00" + } + return MarshalBinary(&f.Length, &f.Flags, &f.CaseType, &f.ID, name) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (f *FileNameV3) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + fields := []interface{}{ + &f.Length, &f.Flags, &f.CaseType, &f.ID, + } + + for _, p := range fields { + if err := binary.Read(buf, binary.LittleEndian, p); err != nil { + return err + } + } + + f.Name = string(buf.Next(int(f.Length))) + + return nil +} + +// FromString converts name to a FileNameV3 +func (f *FileNameV3) FromString(name string) { + p := new(FileName) + p.FromString(name) + f.Name = p.Name + f.Length = p.Length +} + +// Path converts FileNameV3 to a string +func (f *FileNameV3) Path() string { + return (&FileName{Name: f.Name, Length: f.Length}).Path() +} + +// FileType +const ( + FileTypeRegular = iota + FileTypeDirectory + FileTypeSymlink +) + +// AttrV2 as defined in hgfsProto.h:HgfsAttrV2 +type AttrV2 struct { + Mask uint64 + Type int32 + Size uint64 + CreationTime uint64 + AccessTime uint64 + WriteTime uint64 + AttrChangeTime uint64 + SpecialPerms uint8 + OwnerPerms uint8 + GroupPerms uint8 + OtherPerms uint8 + AttrFlags uint64 + AllocationSize uint64 + UserID uint32 + GroupID uint32 + HostFileID uint64 + VolumeID uint32 + EffectivePerms uint32 + Reserved2 uint64 +} + +// RequestGetattrV2 as defined in hgfsProto.h:HgfsRequestGetattrV2 +type RequestGetattrV2 struct { + Request + AttrHint uint64 + Handle uint32 + FileName FileName +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *RequestGetattrV2) MarshalBinary() ([]byte, error) { + return MarshalBinary(&r.Request, &r.AttrHint, &r.Handle, &r.FileName) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *RequestGetattrV2) UnmarshalBinary(data []byte) error { + return UnmarshalBinary(data, &r.Request, &r.AttrHint, &r.Handle, &r.FileName) +} + +// ReplyGetattrV2 as defined in hgfsProto.h:HgfsReplyGetattrV2 +type ReplyGetattrV2 struct { + Reply + Attr AttrV2 + SymlinkTarget FileName +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *ReplyGetattrV2) MarshalBinary() ([]byte, error) { + return MarshalBinary(&r.Reply, &r.Attr, &r.SymlinkTarget) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *ReplyGetattrV2) UnmarshalBinary(data []byte) error { + return UnmarshalBinary(data, &r.Reply, &r.Attr, &r.SymlinkTarget) +} + +// RequestSetattrV2 as defined in hgfsProto.h:HgfsRequestSetattrV2 +type RequestSetattrV2 struct { + Request + Hints uint64 + Attr AttrV2 + Handle uint32 + FileName FileName +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *RequestSetattrV2) MarshalBinary() ([]byte, error) { + return MarshalBinary(&r.Request, &r.Hints, &r.Attr, &r.Handle, &r.FileName) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *RequestSetattrV2) UnmarshalBinary(data []byte) error { + return UnmarshalBinary(data, &r.Request, &r.Hints, &r.Attr, &r.Handle, &r.FileName) +} + +// ReplySetattrV2 as defined in hgfsProto.h:HgfsReplySetattrV2 +type ReplySetattrV2 struct { + Header Reply +} + +// OpenMode +const ( + OpenModeReadOnly = iota + OpenModeWriteOnly + OpenModeReadWrite + OpenModeAccmodes +) + +// OpenFlags +const ( + Open = iota + OpenEmpty + OpenCreate + OpenCreateSafe + OpenCreateEmpty +) + +// Permissions +const ( + PermRead = 4 + PermWrite = 2 + PermExec = 1 +) + +// RequestOpen as defined in hgfsProto.h:HgfsRequestOpen +type RequestOpen struct { + Request + OpenMode int32 + OpenFlags int32 + Permissions uint8 + FileName FileName +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *RequestOpen) MarshalBinary() ([]byte, error) { + return MarshalBinary(&r.Request, &r.OpenMode, &r.OpenFlags, r.Permissions, &r.FileName) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *RequestOpen) UnmarshalBinary(data []byte) error { + return UnmarshalBinary(data, &r.Request, &r.OpenMode, &r.OpenFlags, &r.Permissions, &r.FileName) +} + +// ReplyOpen as defined in hgfsProto.h:HgfsReplyOpen +type ReplyOpen struct { + Reply + Handle uint32 +} + +// RequestClose as defined in hgfsProto.h:HgfsRequestClose +type RequestClose struct { + Request + Handle uint32 +} + +// ReplyClose as defined in hgfsProto.h:HgfsReplyClose +type ReplyClose struct { + Reply +} + +// Lock type +const ( + LockNone = iota + LockOpportunistic + LockExclusive + LockShared + LockBatch + LockLease +) + +// RequestOpenV3 as defined in hgfsProto.h:HgfsRequestOpenV3 +type RequestOpenV3 struct { + Mask uint64 + OpenMode int32 + OpenFlags int32 + SpecialPerms uint8 + OwnerPerms uint8 + GroupPerms uint8 + OtherPerms uint8 + AttrFlags uint64 + AllocationSize uint64 + DesiredAccess uint32 + ShareAccess uint32 + DesiredLock int32 + Reserved1 uint64 + Reserved2 uint64 + FileName FileNameV3 +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *RequestOpenV3) MarshalBinary() ([]byte, error) { + return MarshalBinary(&r.Mask, &r.OpenMode, &r.OpenFlags, + &r.SpecialPerms, &r.OwnerPerms, &r.GroupPerms, &r.OtherPerms, + &r.AttrFlags, &r.AllocationSize, &r.DesiredAccess, &r.ShareAccess, + &r.DesiredLock, &r.Reserved1, &r.Reserved2, &r.FileName) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *RequestOpenV3) UnmarshalBinary(data []byte) error { + return UnmarshalBinary(data, &r.Mask, &r.OpenMode, &r.OpenFlags, + &r.SpecialPerms, &r.OwnerPerms, &r.GroupPerms, &r.OtherPerms, + &r.AttrFlags, &r.AllocationSize, &r.DesiredAccess, &r.ShareAccess, + &r.DesiredLock, &r.Reserved1, &r.Reserved2, &r.FileName) +} + +// ReplyOpenV3 as defined in hgfsProto.h:HgfsReplyOpenV3 +type ReplyOpenV3 struct { + Handle uint32 + AcquiredLock int32 + Flags int32 + Reserved uint32 +} + +// RequestReadV3 as defined in hgfsProto.h:HgfsRequestReadV3 +type RequestReadV3 struct { + Handle uint32 + Offset uint64 + RequiredSize uint32 + Reserved uint64 +} + +// ReplyReadV3 as defined in hgfsProto.h:HgfsReplyReadV3 +type ReplyReadV3 struct { + ActualSize uint32 + Reserved uint64 + Payload []byte +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *ReplyReadV3) MarshalBinary() ([]byte, error) { + return MarshalBinary(&r.ActualSize, &r.Reserved, r.Payload) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *ReplyReadV3) UnmarshalBinary(data []byte) error { + return UnmarshalBinary(data, &r.ActualSize, &r.Reserved, &r.Payload) +} + +// Write flags +const ( + WriteAppend = 1 +) + +// RequestWriteV3 as defined in hgfsProto.h:HgfsRequestWriteV3 +type RequestWriteV3 struct { + Handle uint32 + WriteFlags uint8 + Offset uint64 + RequiredSize uint32 + Reserved uint64 + Payload []byte +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *RequestWriteV3) MarshalBinary() ([]byte, error) { + return MarshalBinary(&r.Handle, &r.WriteFlags, &r.Offset, &r.RequiredSize, &r.Reserved, r.Payload) +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *RequestWriteV3) UnmarshalBinary(data []byte) error { + return UnmarshalBinary(data, &r.Handle, &r.WriteFlags, &r.Offset, &r.RequiredSize, &r.Reserved, &r.Payload) +} + +// ReplyWriteV3 as defined in hgfsProto.h:HgfsReplyWriteV3 +type ReplyWriteV3 struct { + ActualSize uint32 + Reserved uint64 +} diff --git a/vendor/github.com/vmware/govmomi/toolbox/hgfs/server.go b/vendor/github.com/vmware/govmomi/toolbox/hgfs/server.go new file mode 100644 index 00000000000..efc3faf212c --- /dev/null +++ b/vendor/github.com/vmware/govmomi/toolbox/hgfs/server.go @@ -0,0 +1,585 @@ +/* +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 hgfs + +import ( + "errors" + "flag" + "fmt" + "io" + "log" + "math/rand" + "net/url" + "os" + "path/filepath" + "strconv" + "strings" + "sync" + "sync/atomic" +) + +// See: https://github.com/vmware/open-vm-tools/blob/master/open-vm-tools/lib/hgfsServer/hgfsServer.c + +var ( + // Trace enables hgfs packet tracing + Trace = false +) + +// Server provides an HGFS protocol implementation to support guest tools VmxiHgfsSendPacketCommand +type Server struct { + Capabilities []Capability + + handlers map[int32]func(*Packet) (interface{}, error) + schemes map[string]FileHandler + sessions map[uint64]*session + mu sync.Mutex + handle uint32 + + chmod func(string, os.FileMode) error + chown func(string, int, int) error +} + +// NewServer creates a new Server instance with the default handlers +func NewServer() *Server { + if f := flag.Lookup("toolbox.trace"); f != nil { + Trace, _ = strconv.ParseBool(f.Value.String()) + } + + s := &Server{ + sessions: make(map[uint64]*session), + schemes: make(map[string]FileHandler), + chmod: os.Chmod, + chown: os.Chown, + } + + s.handlers = map[int32]func(*Packet) (interface{}, error){ + OpCreateSessionV4: s.CreateSessionV4, + OpDestroySessionV4: s.DestroySessionV4, + OpGetattrV2: s.GetattrV2, + OpSetattrV2: s.SetattrV2, + OpOpen: s.Open, + OpClose: s.Close, + OpOpenV3: s.OpenV3, + OpReadV3: s.ReadV3, + OpWriteV3: s.WriteV3, + } + + for op := range s.handlers { + s.Capabilities = append(s.Capabilities, Capability{Op: op, Flags: 0x1}) + } + + return s +} + +// RegisterFileHandler enables dispatch to handler for the given scheme. +func (s *Server) RegisterFileHandler(scheme string, handler FileHandler) { + if handler == nil { + delete(s.schemes, scheme) + return + } + s.schemes[scheme] = handler +} + +// Dispatch unpacks the given request packet and dispatches to the appropriate handler +func (s *Server) Dispatch(packet []byte) ([]byte, error) { + req := &Packet{} + + err := req.UnmarshalBinary(packet) + if err != nil { + return nil, err + } + + if Trace { + fmt.Fprintf(os.Stderr, "[hgfs] request %#v\n", req.Header) + } + + var res interface{} + + handler, ok := s.handlers[req.Op] + if ok { + res, err = handler(req) + } else { + err = &Status{ + Code: StatusOperationNotSupported, + Err: fmt.Errorf("unsupported Op(%d)", req.Op), + } + } + + return req.Reply(res, err) +} + +// File interface abstracts standard i/o methods to support transfer +// of regular files and archives of directories. +type File interface { + io.Reader + io.Writer + io.Closer + + Name() string +} + +// FileHandler is the plugin interface for hgfs file transport. +type FileHandler interface { + Stat(*url.URL) (os.FileInfo, error) + Open(*url.URL, int32) (File, error) +} + +// urlParse attempts to convert the given name to a URL with scheme for use as FileHandler dispatch. +func urlParse(name string) *url.URL { + var info os.FileInfo + + u, err := url.Parse(name) + if err == nil && u.Scheme == "" { + info, err = os.Stat(u.Path) + if err == nil && info.IsDir() { + u.Scheme = ArchiveScheme // special case for IsDir() + return u + } + } + + u, err = url.Parse(strings.TrimPrefix(name, "/")) // must appear to be an absolute path or hgfs errors + if err != nil { + u = &url.URL{Path: name} + } + + if u.Scheme == "" { + ix := strings.Index(u.Path, "/") + if ix > 0 { + u.Scheme = u.Path[:ix] + u.Path = u.Path[ix:] + } + } + + return u +} + +// OpenFile selects the File implementation based on file type and mode. +func (s *Server) OpenFile(name string, mode int32) (File, error) { + u := urlParse(name) + + if h, ok := s.schemes[u.Scheme]; ok { + f, serr := h.Open(u, mode) + if serr != os.ErrNotExist { + return f, serr + } + } + + switch mode { + case OpenModeReadOnly: + return os.Open(filepath.Clean(name)) + case OpenModeWriteOnly: + flag := os.O_WRONLY | os.O_CREATE | os.O_TRUNC + return os.OpenFile(name, flag, 0600) + default: + return nil, &Status{ + Err: fmt.Errorf("open mode(%d) not supported for file %q", mode, name), + Code: StatusAccessDenied, + } + } +} + +// Stat wraps os.Stat such that we can report directory types as regular files to support archive streaming. +// In the case of standard vmware-tools, attempts to transfer directories result +// with a VIX_E_NOT_A_FILE (see InitiateFileTransfer{To,From}Guest). +// Note that callers on the VMX side that reach this path are only concerned with: +// - does the file exist? +// - size: +// + used for UI progress with desktop Drag-N-Drop operations, which toolbox does not support. +// + sent to as Content-Length header in response to GET of FileTransferInformation.Url, +// if the first ReadV3 size is > HGFS_LARGE_PACKET_MAX +func (s *Server) Stat(name string) (os.FileInfo, error) { + u := urlParse(name) + + if h, ok := s.schemes[u.Scheme]; ok { + sinfo, serr := h.Stat(u) + if serr != os.ErrNotExist { + return sinfo, serr + } + } + + return os.Stat(name) +} + +type session struct { + files map[uint32]File + mu sync.Mutex +} + +// TODO: we currently depend on the VMX to close files and remove sessions, +// which it does provided it can communicate with the toolbox. Let's look at +// adding session expiration when implementing OpenModeWriteOnly support. +func newSession() *session { + return &session{ + files: make(map[uint32]File), + } +} + +func (s *Server) getSession(p *Packet) (*session, error) { + s.mu.Lock() + session, ok := s.sessions[p.SessionID] + s.mu.Unlock() + + if !ok { + return nil, &Status{ + Code: StatusStaleSession, + Err: errors.New("session not found"), + } + } + + return session, nil +} + +func (s *Server) removeSession(id uint64) bool { + s.mu.Lock() + session, ok := s.sessions[id] + delete(s.sessions, id) + s.mu.Unlock() + + if !ok { + return false + } + + session.mu.Lock() + defer session.mu.Unlock() + + for _, f := range session.files { + log.Printf("[hgfs] session %X removed with open file: %s", id, f.Name()) + _ = f.Close() + } + + return true +} + +// open-vm-tools' session max is 1024, there shouldn't be more than a handful at a given time in our use cases +const maxSessions = 24 + +// CreateSessionV4 handls OpCreateSessionV4 requests +func (s *Server) CreateSessionV4(p *Packet) (interface{}, error) { + const SessionMaxPacketSizeValid = 0x1 + + req := new(RequestCreateSessionV4) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + res := &ReplyCreateSessionV4{ + SessionID: uint64(rand.Int63()), + NumCapabilities: uint32(len(s.Capabilities)), + MaxPacketSize: LargePacketMax, + Flags: SessionMaxPacketSizeValid, + Capabilities: s.Capabilities, + } + + s.mu.Lock() + defer s.mu.Unlock() + if len(s.sessions) > maxSessions { + return nil, &Status{Code: StatusTooManySessions} + } + + s.sessions[res.SessionID] = newSession() + + return res, nil +} + +// DestroySessionV4 handls OpDestroySessionV4 requests +func (s *Server) DestroySessionV4(p *Packet) (interface{}, error) { + if s.removeSession(p.SessionID) { + return &ReplyDestroySessionV4{}, nil + } + + return nil, &Status{Code: StatusStaleSession} +} + +// Stat maps os.FileInfo to AttrV2 +func (a *AttrV2) Stat(info os.FileInfo) { + switch { + case info.IsDir(): + a.Type = FileTypeDirectory + case info.Mode()&os.ModeSymlink == os.ModeSymlink: + a.Type = FileTypeSymlink + default: + a.Type = FileTypeRegular + } + + a.Size = uint64(info.Size()) + + a.Mask = AttrValidType | AttrValidSize + + a.sysStat(info) +} + +// GetattrV2 handles OpGetattrV2 requests +func (s *Server) GetattrV2(p *Packet) (interface{}, error) { + res := &ReplyGetattrV2{} + + req := new(RequestGetattrV2) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + name := req.FileName.Path() + info, err := s.Stat(name) + if err != nil { + return nil, err + } + + res.Attr.Stat(info) + + return res, nil +} + +// SetattrV2 handles OpSetattrV2 requests +func (s *Server) SetattrV2(p *Packet) (interface{}, error) { + res := &ReplySetattrV2{} + + req := new(RequestSetattrV2) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + name := req.FileName.Path() + + _, err = os.Stat(name) + if err != nil && os.IsNotExist(err) { + // assuming this is a virtual file + return res, nil + } + + uid := -1 + if req.Attr.Mask&AttrValidUserID == AttrValidUserID { + uid = int(req.Attr.UserID) + } + + gid := -1 + if req.Attr.Mask&AttrValidGroupID == AttrValidGroupID { + gid = int(req.Attr.GroupID) + } + + err = s.chown(name, uid, gid) + if err != nil { + return nil, err + } + + var perm os.FileMode + + if req.Attr.Mask&AttrValidOwnerPerms == AttrValidOwnerPerms { + perm |= os.FileMode(req.Attr.OwnerPerms) << 6 + } + + if req.Attr.Mask&AttrValidGroupPerms == AttrValidGroupPerms { + perm |= os.FileMode(req.Attr.GroupPerms) << 3 + } + + if req.Attr.Mask&AttrValidOtherPerms == AttrValidOtherPerms { + perm |= os.FileMode(req.Attr.OtherPerms) + } + + if perm != 0 { + err = s.chmod(name, perm) + if err != nil { + return nil, err + } + } + + return res, nil +} + +func (s *Server) newHandle() uint32 { + return atomic.AddUint32(&s.handle, 1) +} + +// Open handles OpOpen requests +func (s *Server) Open(p *Packet) (interface{}, error) { + req := new(RequestOpen) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + session, err := s.getSession(p) + if err != nil { + return nil, err + } + + name := req.FileName.Path() + mode := req.OpenMode + + if mode != OpenModeReadOnly { + return nil, &Status{ + Err: fmt.Errorf("open mode(%d) not supported for file %q", mode, name), + Code: StatusAccessDenied, + } + } + + file, err := s.OpenFile(name, mode) + if err != nil { + return nil, err + } + + res := &ReplyOpen{ + Handle: s.newHandle(), + } + + session.mu.Lock() + session.files[res.Handle] = file + session.mu.Unlock() + + return res, nil +} + +// Close handles OpClose requests +func (s *Server) Close(p *Packet) (interface{}, error) { + req := new(RequestClose) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + session, err := s.getSession(p) + if err != nil { + return nil, err + } + + session.mu.Lock() + file, ok := session.files[req.Handle] + if ok { + delete(session.files, req.Handle) + } + session.mu.Unlock() + + if ok { + err = file.Close() + } else { + return nil, &Status{Code: StatusInvalidHandle} + } + + return &ReplyClose{}, err +} + +// OpenV3 handles OpOpenV3 requests +func (s *Server) OpenV3(p *Packet) (interface{}, error) { + req := new(RequestOpenV3) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + session, err := s.getSession(p) + if err != nil { + return nil, err + } + + name := req.FileName.Path() + + if req.DesiredLock != LockNone { + return nil, &Status{ + Err: fmt.Errorf("open lock type=%d not supported for file %q", req.DesiredLock, name), + Code: StatusOperationNotSupported, + } + } + + file, err := s.OpenFile(name, req.OpenMode) + if err != nil { + return nil, err + } + + res := &ReplyOpenV3{ + Handle: s.newHandle(), + } + + session.mu.Lock() + session.files[res.Handle] = file + session.mu.Unlock() + + return res, nil +} + +// ReadV3 handles OpReadV3 requests +func (s *Server) ReadV3(p *Packet) (interface{}, error) { + req := new(RequestReadV3) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + session, err := s.getSession(p) + if err != nil { + return nil, err + } + + session.mu.Lock() + file, ok := session.files[req.Handle] + session.mu.Unlock() + + if !ok { + return nil, &Status{Code: StatusInvalidHandle} + } + + buf := make([]byte, req.RequiredSize) + + // Use ReadFull as Read() of an archive io.Pipe may return much smaller chunks, + // such as when we've read a tar header. + n, err := io.ReadFull(file, buf) + if err != nil && n == 0 { + if err != io.EOF { + return nil, err + } + } + + res := &ReplyReadV3{ + ActualSize: uint32(n), + Payload: buf[:n], + } + + return res, nil +} + +// WriteV3 handles OpWriteV3 requests +func (s *Server) WriteV3(p *Packet) (interface{}, error) { + req := new(RequestWriteV3) + err := UnmarshalBinary(p.Payload, req) + if err != nil { + return nil, err + } + + session, err := s.getSession(p) + if err != nil { + return nil, err + } + + session.mu.Lock() + file, ok := session.files[req.Handle] + session.mu.Unlock() + + if !ok { + return nil, &Status{Code: StatusInvalidHandle} + } + + n, err := file.Write(req.Payload) + if err != nil { + return nil, err + } + + res := &ReplyWriteV3{ + ActualSize: uint32(n), + } + + return res, nil +} diff --git a/vendor/github.com/vmware/govmomi/toolbox/process/process.go b/vendor/github.com/vmware/govmomi/toolbox/process/process.go new file mode 100644 index 00000000000..312a0cf345a --- /dev/null +++ b/vendor/github.com/vmware/govmomi/toolbox/process/process.go @@ -0,0 +1,641 @@ +/* +Copyright (c) 2017-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 process + +import ( + "bytes" + "context" + "fmt" + "io" + "io/ioutil" + "net" + "net/url" + "os" + "os/exec" + "path" + "path/filepath" + "strconv" + "strings" + "sync" + "sync/atomic" + "syscall" + "time" + + "github.com/vmware/govmomi/toolbox/hgfs" + "github.com/vmware/govmomi/toolbox/vix" +) + +var ( + EscapeXML *strings.Replacer + + shell = "/bin/sh" + + defaultOwner = os.Getenv("USER") +) + +func init() { + // See: VixToolsEscapeXMLString + chars := []string{ + `"`, + "%", + "&", + "'", + "<", + ">", + } + + replace := make([]string, 0, len(chars)*2) + + for _, c := range chars { + replace = append(replace, c) + replace = append(replace, url.QueryEscape(c)) + } + + EscapeXML = strings.NewReplacer(replace...) + + // See procMgrPosix.c:ProcMgrStartProcess: + // Prefer bash -c as is uses exec() to replace itself, + // whereas bourne shell does a fork & exec, so two processes are started. + if sh, err := exec.LookPath("bash"); err != nil { + shell = sh + } + + if defaultOwner == "" { + defaultOwner = "toolbox" + } +} + +// IO encapsulates IO for Go functions and OS commands such that they can interact via the OperationsManager +// without file system disk IO. +type IO struct { + In struct { + io.Writer + io.Reader + io.Closer // Closer for the write side of the pipe, can be closed via hgfs ops (FileTranfserToGuest) + } + + Out *bytes.Buffer + Err *bytes.Buffer +} + +// State is the toolbox representation of the GuestProcessInfo type +type State struct { + StartTime int64 // (keep first to ensure 64-bit alignment) + EndTime int64 // (keep first to ensure 64-bit alignment) + + Name string + Args string + Owner string + Pid int64 + ExitCode int32 + + IO *IO +} + +// WithIO enables toolbox Process IO without file system disk IO. +func (p *Process) WithIO() *Process { + p.IO = &IO{ + Out: new(bytes.Buffer), + Err: new(bytes.Buffer), + } + + return p +} + +// File implements the os.FileInfo interface to enable toolbox interaction with virtual files. +type File struct { + io.Reader + io.Writer + io.Closer + + name string + size int +} + +// Name implementation of the os.FileInfo interface method. +func (a *File) Name() string { + return a.name +} + +// Size implementation of the os.FileInfo interface method. +func (a *File) Size() int64 { + return int64(a.size) +} + +// Mode implementation of the os.FileInfo interface method. +func (a *File) Mode() os.FileMode { + if strings.HasSuffix(a.name, "stdin") { + return 0200 + } + return 0400 +} + +// ModTime implementation of the os.FileInfo interface method. +func (a *File) ModTime() time.Time { + return time.Now() +} + +// IsDir implementation of the os.FileInfo interface method. +func (a *File) IsDir() bool { + return false +} + +// Sys implementation of the os.FileInfo interface method. +func (a *File) Sys() interface{} { + return nil +} + +func (s *State) toXML() string { + const format = "" + + "%s" + + "%s" + + "%d" + + "%s" + + "%d" + + "%d" + + "%d" + + "" + + name := filepath.Base(s.Name) + + argv := []string{s.Name} + + if len(s.Args) != 0 { + argv = append(argv, EscapeXML.Replace(s.Args)) + } + + args := strings.Join(argv, " ") + + return fmt.Sprintf(format, name, args, s.Pid, s.Owner, s.StartTime, s.ExitCode, s.EndTime) +} + +// Process managed by the process Manager. +type Process struct { + State + + Start func(*Process, *vix.StartProgramRequest) (int64, error) + Wait func() error + Kill context.CancelFunc + + ctx context.Context +} + +// Error can be returned by the Process.Wait function to propagate ExitCode to process State. +type Error struct { + Err error + ExitCode int32 +} + +func (e *Error) Error() string { + return e.Err.Error() +} + +// Manager manages processes within the guest. +// See: http://pubs.vmware.com/vsphere-60/topic/com.vmware.wssdk.apiref.doc/vim.vm.guest.Manager.html +type Manager struct { + wg sync.WaitGroup + mu sync.Mutex + expire time.Duration + entries map[int64]*Process + pids sync.Pool +} + +// NewManager creates a new process Manager instance. +func NewManager() *Manager { + // We use pseudo PIDs that don't conflict with OS PIDs, so they can live in the same table. + // For the pseudo PIDs, we use a sync.Pool rather than a plain old counter to avoid the unlikely, + // but possible wrapping should such a counter exceed MaxInt64. + pid := int64(32768) // TODO: /proc/sys/kernel/pid_max + + return &Manager{ + expire: time.Minute * 5, + entries: make(map[int64]*Process), + pids: sync.Pool{ + New: func() interface{} { + return atomic.AddInt64(&pid, 1) + }, + }, + } +} + +// Start calls the Process.Start function, returning the pid on success or an error. +// A goroutine is started that calls the Process.Wait function. After Process.Wait has +// returned, the process State EndTime and ExitCode fields are set. The process state can be +// queried via ListProcessesInGuest until it is removed, 5 minutes after Wait returns. +func (m *Manager) Start(r *vix.StartProgramRequest, p *Process) (int64, error) { + p.Name = r.ProgramPath + p.Args = r.Arguments + + // Owner is cosmetic, but useful for example with: govc guest.ps -U $uid + if p.Owner == "" { + p.Owner = defaultOwner + } + + p.StartTime = time.Now().Unix() + + p.ctx, p.Kill = context.WithCancel(context.Background()) + + pid, err := p.Start(p, r) + if err != nil { + return -1, err + } + + if pid == 0 { + p.Pid = m.pids.Get().(int64) // pseudo pid for funcs + } else { + p.Pid = pid + } + + m.mu.Lock() + m.entries[p.Pid] = p + m.mu.Unlock() + + m.wg.Add(1) + go func() { + werr := p.Wait() + + m.mu.Lock() + p.EndTime = time.Now().Unix() + + if werr != nil { + rc := int32(1) + if xerr, ok := werr.(*Error); ok { + rc = xerr.ExitCode + } + + p.ExitCode = rc + } + + m.mu.Unlock() + m.wg.Done() + p.Kill() // cancel context for those waiting on p.ctx.Done() + + // See: http://pubs.vmware.com/vsphere-65/topic/com.vmware.wssdk.apiref.doc/vim.vm.guest.ProcessManager.ProcessInfo.html + // "If the process was started using StartProgramInGuest then the process completion time + // will be available if queried within 5 minutes after it completes." + <-time.After(m.expire) + + m.mu.Lock() + delete(m.entries, p.Pid) + m.mu.Unlock() + + if pid == 0 { + m.pids.Put(p.Pid) // pseudo pid can be reused now + } + }() + + return p.Pid, nil +} + +// Kill cancels the Process Context. +// Returns true if pid exists in the process table, false otherwise. +func (m *Manager) Kill(pid int64) bool { + m.mu.Lock() + entry, ok := m.entries[pid] + m.mu.Unlock() + + if ok { + entry.Kill() + return true + } + + return false +} + +// ListProcesses marshals the process State for the given pids. +// If no pids are specified, all current processes are included. +// The return value can be used for responding to a VixMsgListProcessesExRequest. +func (m *Manager) ListProcesses(pids []int64) []byte { + w := new(bytes.Buffer) + + for _, p := range m.List(pids) { + _, _ = w.WriteString(p.toXML()) + } + + return w.Bytes() +} + +// List the process State for the given pids. +func (m *Manager) List(pids []int64) []State { + var list []State + + m.mu.Lock() + + if len(pids) == 0 { + for _, p := range m.entries { + list = append(list, p.State) + } + } else { + for _, id := range pids { + p, ok := m.entries[id] + if !ok { + continue + } + + list = append(list, p.State) + } + } + + m.mu.Unlock() + + return list +} + +type procFileInfo struct { + os.FileInfo +} + +// Size returns hgfs.LargePacketMax such that InitiateFileTransferFromGuest can download a /proc/ file from the guest. +// If we were to return the size '0' here, then a 'Content-Length: 0' header is returned by VC/ESX. +func (p procFileInfo) Size() int64 { + return hgfs.LargePacketMax // Remember, Sully, when I promised to kill you last? I lied. +} + +// Stat implements hgfs.FileHandler.Stat +func (m *Manager) Stat(u *url.URL) (os.FileInfo, error) { + name := path.Join("/proc", u.Path) + + info, err := os.Stat(name) + if err == nil && info.Size() == 0 { + // This is a real /proc file + return &procFileInfo{info}, nil + } + + dir, file := path.Split(u.Path) + + pid, err := strconv.ParseInt(path.Base(dir), 10, 64) + if err != nil { + return nil, os.ErrNotExist + } + + m.mu.Lock() + p := m.entries[pid] + m.mu.Unlock() + + if p == nil || p.IO == nil { + return nil, os.ErrNotExist + } + + pf := &File{ + name: name, + Closer: ioutil.NopCloser(nil), // via hgfs, nop for stdout and stderr + } + + var r *bytes.Buffer + + switch file { + case "stdin": + pf.Writer = p.IO.In.Writer + pf.Closer = p.IO.In.Closer + return pf, nil + case "stdout": + r = p.IO.Out + case "stderr": + r = p.IO.Err + default: + return nil, os.ErrNotExist + } + + select { + case <-p.ctx.Done(): + case <-time.After(time.Second): + // The vmx guest RPC calls are queue based, serialized on the vmx side. + // There are 5 seconds between "ping" RPC calls and after a few misses, + // the vmx considers tools as not running. In this case, the vmx would timeout + // a file transfer after 60 seconds. + // + // vix.FileAccessError is converted to a CannotAccessFile fault, + // so the client can choose to retry the transfer in this case. + // Would have preferred vix.ObjectIsBusy (EBUSY), but VC/ESX converts that + // to a general SystemErrorFault with nothing but a localized string message + // to check against: "vix error codes = (5, 0)." + // Is standard vmware-tools, EACCES is converted to a CannotAccessFile fault. + return nil, vix.Error(vix.FileAccessError) + } + + pf.Reader = r + pf.size = r.Len() + + return pf, nil +} + +// Open implements hgfs.FileHandler.Open +func (m *Manager) Open(u *url.URL, mode int32) (hgfs.File, error) { + info, err := m.Stat(u) + if err != nil { + return nil, err + } + + pinfo, ok := info.(*File) + + if !ok { + return nil, os.ErrNotExist // fall through to default os.Open + } + + switch path.Base(u.Path) { + case "stdin": + if mode != hgfs.OpenModeWriteOnly { + return nil, vix.Error(vix.InvalidArg) + } + case "stdout", "stderr": + if mode != hgfs.OpenModeReadOnly { + return nil, vix.Error(vix.InvalidArg) + } + } + + return pinfo, nil +} + +type processFunc struct { + wg sync.WaitGroup + + run func(context.Context, string) error + + err error +} + +// NewFunc creates a new Process, where the Start function calls the given run function within a goroutine. +// The Wait function waits for the goroutine to finish and returns the error returned by run. +// The run ctx param may be used to return early via the process Manager.Kill method. +// The run args command is that of the VixMsgStartProgramRequest.Arguments field. +func NewFunc(run func(ctx context.Context, args string) error) *Process { + f := &processFunc{run: run} + + return &Process{ + Start: f.start, + Wait: f.wait, + } +} + +// FuncIO is the Context key to access optional ProcessIO +var FuncIO = struct { + key int64 +}{vix.CommandMagicWord} + +func (f *processFunc) start(p *Process, r *vix.StartProgramRequest) (int64, error) { + f.wg.Add(1) + + var c io.Closer + + if p.IO != nil { + pr, pw := io.Pipe() + + p.IO.In.Reader, p.IO.In.Writer = pr, pw + c, p.IO.In.Closer = pr, pw + + p.ctx = context.WithValue(p.ctx, FuncIO, p.IO) + } + + go func() { + f.err = f.run(p.ctx, r.Arguments) + + if p.IO != nil { + _ = c.Close() + + if f.err != nil && p.IO.Err.Len() == 0 { + p.IO.Err.WriteString(f.err.Error()) + } + } + + f.wg.Done() + }() + + return 0, nil +} + +func (f *processFunc) wait() error { + f.wg.Wait() + return f.err +} + +type processCmd struct { + cmd *exec.Cmd +} + +// New creates a new Process, where the Start function use exec.CommandContext to create and start the process. +// The Wait function waits for the process to finish and returns the error returned by exec.Cmd.Wait(). +// Prior to Wait returning, the exec.Cmd.Wait() error is used to set the Process.ExitCode, if error is of type exec.ExitError. +// The ctx param may be used to kill the process via the process Manager.Kill method. +// The VixMsgStartProgramRequest param fields are mapped to the exec.Cmd counterpart fields. +// Processes are started within a sub-shell, allowing for i/o redirection, just as with the C version of vmware-tools. +func New() *Process { + c := new(processCmd) + + return &Process{ + Start: c.start, + Wait: c.wait, + } +} + +func (c *processCmd) start(p *Process, r *vix.StartProgramRequest) (int64, error) { + name, err := exec.LookPath(r.ProgramPath) + if err != nil { + return -1, err + } + // #nosec: Subprocess launching with variable + // Note that processCmd is currently used only for testing. + c.cmd = exec.CommandContext(p.ctx, shell, "-c", fmt.Sprintf("%s %s", name, r.Arguments)) + c.cmd.Dir = r.WorkingDir + c.cmd.Env = r.EnvVars + + if p.IO != nil { + in, perr := c.cmd.StdinPipe() + if perr != nil { + return -1, perr + } + + p.IO.In.Writer = in + p.IO.In.Closer = in + + // Note we currently use a Buffer in addition to the os.Pipe so that: + // - Stat() can provide a size + // - FileTransferFromGuest won't block + // - Can't use the exec.Cmd.Std{out,err}Pipe methods since Wait() closes the pipes. + // We could use os.Pipe directly, but toolbox needs to take care of closing both ends, + // but also need to prevent FileTransferFromGuest from blocking. + c.cmd.Stdout = p.IO.Out + c.cmd.Stderr = p.IO.Err + } + + err = c.cmd.Start() + if err != nil { + return -1, err + } + + return int64(c.cmd.Process.Pid), nil +} + +func (c *processCmd) wait() error { + err := c.cmd.Wait() + if err != nil { + xerr := &Error{ + Err: err, + ExitCode: 1, + } + + if x, ok := err.(*exec.ExitError); ok { + if status, ok := x.Sys().(syscall.WaitStatus); ok { + xerr.ExitCode = int32(status.ExitStatus()) + } + } + + return xerr + } + + return nil +} + +// NewRoundTrip starts a Go function to implement a toolbox backed http.RoundTripper +func NewRoundTrip() *Process { + return NewFunc(func(ctx context.Context, host string) error { + p, _ := ctx.Value(FuncIO).(*IO) + + closers := []io.Closer{p.In.Closer} + + defer func() { + for _, c := range closers { + _ = c.Close() + } + }() + + c, err := new(net.Dialer).DialContext(ctx, "tcp", host) + if err != nil { + return err + } + + closers = append(closers, c) + + go func() { + <-ctx.Done() + if ctx.Err() == context.DeadlineExceeded { + _ = c.Close() + } + }() + + _, err = io.Copy(c, p.In.Reader) + if err != nil { + return err + } + + _, err = io.Copy(p.Out, c) + if err != nil { + return err + } + + return nil + }).WithIO() +} diff --git a/vendor/github.com/vmware/govmomi/toolbox/vix/property.go b/vendor/github.com/vmware/govmomi/toolbox/vix/property.go new file mode 100644 index 00000000000..914de0869da --- /dev/null +++ b/vendor/github.com/vmware/govmomi/toolbox/vix/property.go @@ -0,0 +1,236 @@ +/* +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 vix + +import ( + "bytes" + "encoding/binary" + "errors" +) + +// Property type enum as defined in open-vm-tools/lib/include/vix.h +const ( + _ = iota // ANY type not supported + vixPropertyTypeInt32 + vixPropertyTypeString + vixPropertyTypeBool + _ // HANDLE type not supported + vixPropertyTypeInt64 + vixPropertyTypeBlob +) + +// Property ID enum as defined in open-vm-tools/lib/include/vixOpenSource.h +const ( + PropertyGuestToolsAPIOptions = 4501 + PropertyGuestOsFamily = 4502 + PropertyGuestOsVersion = 4503 + PropertyGuestToolsProductNam = 4511 + PropertyGuestToolsVersion = 4500 + PropertyGuestName = 4505 + PropertyGuestOsVersionShort = 4520 + + PropertyGuestStartProgramEnabled = 4540 + PropertyGuestListProcessesEnabled = 4541 + PropertyGuestTerminateProcessEnabled = 4542 + PropertyGuestReadEnvironmentVariableEnabled = 4543 + + PropertyGuestMakeDirectoryEnabled = 4547 + PropertyGuestDeleteFileEnabled = 4548 + PropertyGuestDeleteDirectoryEnabled = 4549 + PropertyGuestMoveDirectoryEnabled = 4550 + PropertyGuestMoveFileEnabled = 4551 + PropertyGuestCreateTempFileEnabled = 4552 + PropertyGuestCreateTempDirectoryEnabled = 4553 + PropertyGuestListFilesEnabled = 4554 + PropertyGuestChangeFileAttributesEnabled = 4555 + PropertyGuestInitiateFileTransferFromGuestEnabled = 4556 + PropertyGuestInitiateFileTransferToGuestEnabled = 4557 +) + +type Property struct { + header struct { + ID int32 + Kind int32 + Length int32 + } + + data struct { + Int32 int32 + String string + Bool uint8 + Int64 int64 + Blob []byte + } +} + +var int32Size int32 + +func init() { + var i int32 + int32Size = int32(binary.Size(&i)) +} + +type PropertyList []*Property + +func NewInt32Property(id int32, val int32) *Property { + p := new(Property) + p.header.ID = id + p.header.Kind = vixPropertyTypeInt32 + p.header.Length = int32Size + p.data.Int32 = val + return p +} + +func NewStringProperty(id int32, val string) *Property { + p := new(Property) + p.header.ID = id + p.header.Kind = vixPropertyTypeString + p.header.Length = int32(len(val) + 1) + p.data.String = val + return p +} + +func NewBoolProperty(id int32, val bool) *Property { + p := new(Property) + p.header.ID = id + p.header.Kind = vixPropertyTypeBool + p.header.Length = 1 + if val { + p.data.Bool = 1 + } + return p +} + +func NewInt64Property(id int32, val int64) *Property { + p := new(Property) + p.header.ID = id + p.header.Kind = vixPropertyTypeInt64 + p.header.Length = int32Size * 2 + p.data.Int64 = val + return p +} + +func NewBlobProperty(id int32, val []byte) *Property { + p := new(Property) + p.header.ID = id + p.header.Kind = vixPropertyTypeBlob + p.header.Length = int32(len(val)) + p.data.Blob = val + return p +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (p *Property) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + // #nosec: Errors unhandled + _ = binary.Write(buf, binary.LittleEndian, &p.header) + + switch p.header.Kind { + case vixPropertyTypeBool: + // #nosec: Errors unhandled + _ = binary.Write(buf, binary.LittleEndian, p.data.Bool) + case vixPropertyTypeInt32: + // #nosec: Errors unhandled + _ = binary.Write(buf, binary.LittleEndian, p.data.Int32) + case vixPropertyTypeInt64: + // #nosec: Errors unhandled + _ = binary.Write(buf, binary.LittleEndian, p.data.Int64) + case vixPropertyTypeString: + // #nosec: Errors unhandled + _, _ = buf.WriteString(p.data.String) + // #nosec: Errors unhandled + _ = buf.WriteByte(0) + case vixPropertyTypeBlob: + // #nosec: Errors unhandled + _, _ = buf.Write(p.data.Blob) + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (p *Property) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &p.header) + if err != nil { + return err + } + + switch p.header.Kind { + case vixPropertyTypeBool: + return binary.Read(buf, binary.LittleEndian, &p.data.Bool) + case vixPropertyTypeInt32: + return binary.Read(buf, binary.LittleEndian, &p.data.Int32) + case vixPropertyTypeInt64: + return binary.Read(buf, binary.LittleEndian, &p.data.Int64) + case vixPropertyTypeString: + s := make([]byte, p.header.Length) + if _, err := buf.Read(s); err != nil { + return err + } + + p.data.String = string(bytes.TrimRight(s, "\x00")) + case vixPropertyTypeBlob: + p.data.Blob = make([]byte, p.header.Length) + if _, err := buf.Read(p.data.Blob); err != nil { + return err + } + default: + return errors.New("VIX_E_UNRECOGNIZED_PROPERTY") + } + + return nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (l *PropertyList) UnmarshalBinary(data []byte) error { + headerSize := int32Size * 3 + + for { + p := new(Property) + + err := p.UnmarshalBinary(data) + if err != nil { + return err + } + + *l = append(*l, p) + + offset := headerSize + p.header.Length + data = data[offset:] + + if len(data) == 0 { + return nil + } + } +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (l *PropertyList) MarshalBinary() ([]byte, error) { + var buf bytes.Buffer + + for _, p := range *l { + // #nosec: Errors unhandled + b, _ := p.MarshalBinary() + // #nosec: Errors unhandled + _, _ = buf.Write(b) + } + + return buf.Bytes(), nil +} diff --git a/vendor/github.com/vmware/govmomi/toolbox/vix/protocol.go b/vendor/github.com/vmware/govmomi/toolbox/vix/protocol.go new file mode 100644 index 00000000000..2709098f070 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/toolbox/vix/protocol.go @@ -0,0 +1,847 @@ +/* +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 vix + +import ( + "bytes" + "encoding/base64" + "encoding/binary" + "fmt" + "os" + "os/exec" + "syscall" +) + +const ( + CommandMagicWord = 0xd00d0001 + + CommandGetToolsState = 62 + + CommandStartProgram = 185 + CommandListProcessesEx = 186 + CommandReadEnvVariables = 187 + CommandTerminateProcess = 193 + + CommandCreateDirectoryEx = 178 + CommandMoveGuestFileEx = 179 + CommandMoveGuestDirectory = 180 + CommandCreateTemporaryFileEx = 181 + CommandCreateTemporaryDirectory = 182 + CommandSetGuestFileAttributes = 183 + CommandDeleteGuestFileEx = 194 + CommandDeleteGuestDirectoryEx = 195 + + CommandListFiles = 177 + HgfsSendPacketCommand = 84 + CommandInitiateFileTransferFromGuest = 188 + CommandInitiateFileTransferToGuest = 189 + + // VIX_USER_CREDENTIAL_NAME_PASSWORD + UserCredentialTypeNamePassword = 1 + + // VIX_E_* constants from vix.h + OK = 0 + Fail = 1 + InvalidArg = 3 + FileNotFound = 4 + FileAlreadyExists = 12 + FileAccessError = 13 + AuthenticationFail = 35 + + UnrecognizedCommandInGuest = 3025 + InvalidMessageHeader = 10000 + InvalidMessageBody = 10001 + NotAFile = 20001 + NotADirectory = 20002 + NoSuchProcess = 20003 + DirectoryNotEmpty = 20006 + + // VIX_COMMAND_* constants from Commands.h + CommandGuestReturnsBinary = 0x80 + + // VIX_FILE_ATTRIBUTES_ constants from vix.h + FileAttributesDirectory = 0x0001 + FileAttributesSymlink = 0x0002 +) + +// SetGuestFileAttributes flags as defined in vixOpenSource.h +const ( + FileAttributeSetAccessDate = 0x0001 + FileAttributeSetModifyDate = 0x0002 + FileAttributeSetReadonly = 0x0004 + FileAttributeSetHidden = 0x0008 + FileAttributeSetUnixOwnerid = 0x0010 + FileAttributeSetUnixGroupid = 0x0020 + FileAttributeSetUnixPermissions = 0x0040 +) + +type Error int + +func (err Error) Error() string { + return fmt.Sprintf("vix error=%d", err) +} + +// ErrorCode does its best to map the given error to a VIX error code. +// See also: Vix_TranslateErrno +func ErrorCode(err error) int { + switch t := err.(type) { + case Error: + return int(t) + case *os.PathError: + if errno, ok := t.Err.(syscall.Errno); ok { + switch errno { + case syscall.ENOTEMPTY: + return DirectoryNotEmpty + } + } + case *exec.Error: + if t.Err == exec.ErrNotFound { + return FileNotFound + } + } + + switch { + case os.IsNotExist(err): + return FileNotFound + case os.IsExist(err): + return FileAlreadyExists + case os.IsPermission(err): + return FileAccessError + default: + return Fail + } +} + +type Header struct { + Magic uint32 + MessageVersion uint16 + + TotalMessageLength uint32 + HeaderLength uint32 + BodyLength uint32 + CredentialLength uint32 + + CommonFlags uint8 +} + +type CommandRequestHeader struct { + Header + + OpCode uint32 + RequestFlags uint32 + + TimeOut uint32 + + Cookie uint64 + ClientHandleID uint32 + + UserCredentialType uint32 +} + +type StartProgramRequest struct { + CommandRequestHeader + + Body struct { + StartMinimized uint8 + ProgramPathLength uint32 + ArgumentsLength uint32 + WorkingDirLength uint32 + NumEnvVars uint32 + EnvVarLength uint32 + } + + ProgramPath string + Arguments string + WorkingDir string + EnvVars []string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *StartProgramRequest) MarshalBinary() ([]byte, error) { + var env bytes.Buffer + + if n := len(r.EnvVars); n != 0 { + for _, e := range r.EnvVars { + _, _ = env.Write([]byte(e)) + _ = env.WriteByte(0) + } + r.Body.NumEnvVars = uint32(n) + r.Body.EnvVarLength = uint32(env.Len()) + } + + var fields []string + + add := func(s string, l *uint32) { + if n := len(s); n != 0 { + *l = uint32(n) + 1 + fields = append(fields, s) + } + } + + add(r.ProgramPath, &r.Body.ProgramPathLength) + add(r.Arguments, &r.Body.ArgumentsLength) + add(r.WorkingDir, &r.Body.WorkingDirLength) + + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + for _, val := range fields { + _, _ = buf.Write([]byte(val)) + _ = buf.WriteByte(0) + } + + if r.Body.EnvVarLength != 0 { + _, _ = buf.Write(env.Bytes()) + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *StartProgramRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + fields := []struct { + len uint32 + val *string + }{ + {r.Body.ProgramPathLength, &r.ProgramPath}, + {r.Body.ArgumentsLength, &r.Arguments}, + {r.Body.WorkingDirLength, &r.WorkingDir}, + } + + for _, field := range fields { + if field.len == 0 { + continue + } + + x := buf.Next(int(field.len)) + *field.val = string(bytes.TrimRight(x, "\x00")) + } + + for i := 0; i < int(r.Body.NumEnvVars); i++ { + env, rerr := buf.ReadString(0) + if rerr != nil { + return rerr + } + + env = env[:len(env)-1] // discard NULL terminator + r.EnvVars = append(r.EnvVars, env) + } + + return nil +} + +type KillProcessRequest struct { + CommandRequestHeader + + Body struct { + Pid int64 + Options uint32 + } +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *KillProcessRequest) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *KillProcessRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + return binary.Read(buf, binary.LittleEndian, &r.Body) +} + +type ListProcessesRequest struct { + CommandRequestHeader + + Body struct { + Key uint32 + Offset uint32 + NumPids uint32 + } + + Pids []int64 +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *ListProcessesRequest) MarshalBinary() ([]byte, error) { + r.Body.NumPids = uint32(len(r.Pids)) + + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + for _, pid := range r.Pids { + _ = binary.Write(buf, binary.LittleEndian, &pid) + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *ListProcessesRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + r.Pids = make([]int64, r.Body.NumPids) + + for i := uint32(0); i < r.Body.NumPids; i++ { + err := binary.Read(buf, binary.LittleEndian, &r.Pids[i]) + if err != nil { + return err + } + } + + return nil +} + +type ReadEnvironmentVariablesRequest struct { + CommandRequestHeader + + Body struct { + NumNames uint32 + NamesLength uint32 + } + + Names []string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *ReadEnvironmentVariablesRequest) MarshalBinary() ([]byte, error) { + var env bytes.Buffer + + if n := len(r.Names); n != 0 { + for _, e := range r.Names { + _, _ = env.Write([]byte(e)) + _ = env.WriteByte(0) + } + r.Body.NumNames = uint32(n) + r.Body.NamesLength = uint32(env.Len()) + } + + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + if r.Body.NamesLength != 0 { + _, _ = buf.Write(env.Bytes()) + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *ReadEnvironmentVariablesRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + for i := 0; i < int(r.Body.NumNames); i++ { + env, rerr := buf.ReadString(0) + if rerr != nil { + return rerr + } + + env = env[:len(env)-1] // discard NULL terminator + r.Names = append(r.Names, env) + } + + return nil +} + +type CreateTempFileRequest struct { + CommandRequestHeader + + Body struct { + Options int32 + FilePrefixLength uint32 + FileSuffixLength uint32 + DirectoryPathLength uint32 + PropertyListLength uint32 + } + + FilePrefix string + FileSuffix string + DirectoryPath string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *CreateTempFileRequest) MarshalBinary() ([]byte, error) { + var fields []string + + add := func(s string, l *uint32) { + *l = uint32(len(s)) // NOTE: NULL byte is not included in the length fields on the wire + fields = append(fields, s) + } + + add(r.FilePrefix, &r.Body.FilePrefixLength) + add(r.FileSuffix, &r.Body.FileSuffixLength) + add(r.DirectoryPath, &r.Body.DirectoryPathLength) + + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + for _, val := range fields { + _, _ = buf.Write([]byte(val)) + _ = buf.WriteByte(0) + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *CreateTempFileRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + fields := []struct { + len uint32 + val *string + }{ + {r.Body.FilePrefixLength, &r.FilePrefix}, + {r.Body.FileSuffixLength, &r.FileSuffix}, + {r.Body.DirectoryPathLength, &r.DirectoryPath}, + } + + for _, field := range fields { + field.len++ // NOTE: NULL byte is not included in the length fields on the wire + + x := buf.Next(int(field.len)) + *field.val = string(bytes.TrimRight(x, "\x00")) + } + + return nil +} + +type FileRequest struct { + CommandRequestHeader + + Body struct { + FileOptions int32 + GuestPathNameLength uint32 + } + + GuestPathName string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *FileRequest) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + r.Body.GuestPathNameLength = uint32(len(r.GuestPathName)) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + _, _ = buf.WriteString(r.GuestPathName) + _ = buf.WriteByte(0) + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *FileRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + name := buf.Next(int(r.Body.GuestPathNameLength)) + r.GuestPathName = string(bytes.TrimRight(name, "\x00")) + + return nil +} + +type DirRequest struct { + CommandRequestHeader + + Body struct { + FileOptions int32 + GuestPathNameLength uint32 + FilePropertiesLength uint32 + Recursive bool + } + + GuestPathName string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *DirRequest) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + r.Body.GuestPathNameLength = uint32(len(r.GuestPathName)) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + _, _ = buf.WriteString(r.GuestPathName) + _ = buf.WriteByte(0) + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *DirRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + name := buf.Next(int(r.Body.GuestPathNameLength)) + r.GuestPathName = string(bytes.TrimRight(name, "\x00")) + + return nil +} + +type RenameFileRequest struct { + CommandRequestHeader + + Body struct { + CopyFileOptions int32 + OldPathNameLength uint32 + NewPathNameLength uint32 + FilePropertiesLength uint32 + Overwrite bool + } + + OldPathName string + NewPathName string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *RenameFileRequest) MarshalBinary() ([]byte, error) { + var fields []string + + add := func(s string, l *uint32) { + *l = uint32(len(s)) // NOTE: NULL byte is not included in the length fields on the wire + fields = append(fields, s) + } + + add(r.OldPathName, &r.Body.OldPathNameLength) + add(r.NewPathName, &r.Body.NewPathNameLength) + + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + for _, val := range fields { + _, _ = buf.Write([]byte(val)) + _ = buf.WriteByte(0) + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *RenameFileRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + fields := []struct { + len uint32 + val *string + }{ + {r.Body.OldPathNameLength, &r.OldPathName}, + {r.Body.NewPathNameLength, &r.NewPathName}, + } + + for _, field := range fields { + field.len++ // NOTE: NULL byte is not included in the length fields on the wire + + x := buf.Next(int(field.len)) + *field.val = string(bytes.TrimRight(x, "\x00")) + } + + return nil +} + +type ListFilesRequest struct { + CommandRequestHeader + + Body struct { + FileOptions int32 + GuestPathNameLength uint32 + PatternLength uint32 + Index int32 + MaxResults int32 + Offset uint64 + } + + GuestPathName string + Pattern string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *ListFilesRequest) MarshalBinary() ([]byte, error) { + var fields []string + + add := func(s string, l *uint32) { + if n := len(s); n != 0 { + *l = uint32(n) + 1 + fields = append(fields, s) + } + } + + add(r.GuestPathName, &r.Body.GuestPathNameLength) + add(r.Pattern, &r.Body.PatternLength) + + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + for _, val := range fields { + _, _ = buf.Write([]byte(val)) + _ = buf.WriteByte(0) + } + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *ListFilesRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + fields := []struct { + len uint32 + val *string + }{ + {r.Body.GuestPathNameLength, &r.GuestPathName}, + {r.Body.PatternLength, &r.Pattern}, + } + + for _, field := range fields { + if field.len == 0 { + continue + } + + x := buf.Next(int(field.len)) + *field.val = string(bytes.TrimRight(x, "\x00")) + } + + return nil +} + +type SetGuestFileAttributesRequest struct { + CommandRequestHeader + + Body struct { + FileOptions int32 + AccessTime int64 + ModificationTime int64 + OwnerID int32 + GroupID int32 + Permissions int32 + Hidden bool + ReadOnly bool + GuestPathNameLength uint32 + } + + GuestPathName string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *SetGuestFileAttributesRequest) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + r.Body.GuestPathNameLength = uint32(len(r.GuestPathName)) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + _, _ = buf.WriteString(r.GuestPathName) + _ = buf.WriteByte(0) + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *SetGuestFileAttributesRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + name := buf.Next(int(r.Body.GuestPathNameLength)) + r.GuestPathName = string(bytes.TrimRight(name, "\x00")) + + return nil +} + +func (r *SetGuestFileAttributesRequest) IsSet(opt int32) bool { + return r.Body.FileOptions&opt == opt +} + +type CommandHgfsSendPacket struct { + CommandRequestHeader + + Body struct { + PacketSize uint32 + Timeout int32 + } + + Packet []byte +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *CommandHgfsSendPacket) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + _, _ = buf.Write(r.Packet) + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *CommandHgfsSendPacket) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + r.Packet = buf.Next(int(r.Body.PacketSize)) + + return nil +} + +type InitiateFileTransferToGuestRequest struct { + CommandRequestHeader + + Body struct { + Options int32 + GuestPathNameLength uint32 + Overwrite bool + } + + GuestPathName string +} + +// MarshalBinary implements the encoding.BinaryMarshaler interface +func (r *InitiateFileTransferToGuestRequest) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + r.Body.GuestPathNameLength = uint32(len(r.GuestPathName)) + + _ = binary.Write(buf, binary.LittleEndian, &r.Body) + + _, _ = buf.WriteString(r.GuestPathName) + _ = buf.WriteByte(0) + + return buf.Bytes(), nil +} + +// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface +func (r *InitiateFileTransferToGuestRequest) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(data) + + err := binary.Read(buf, binary.LittleEndian, &r.Body) + if err != nil { + return err + } + + name := buf.Next(int(r.Body.GuestPathNameLength)) + r.GuestPathName = string(bytes.TrimRight(name, "\x00")) + + return nil +} + +type UserCredentialNamePassword struct { + Body struct { + NameLength uint32 + PasswordLength uint32 + } + + Name string + Password string +} + +func (c *UserCredentialNamePassword) UnmarshalBinary(data []byte) error { + buf := bytes.NewBuffer(bytes.TrimRight(data, "\x00")) + + err := binary.Read(buf, binary.LittleEndian, &c.Body) + if err != nil { + return err + } + + str, err := base64.StdEncoding.DecodeString(buf.String()) + if err != nil { + return err + } + + c.Name = string(str[0:c.Body.NameLength]) + c.Password = string(str[c.Body.NameLength+1 : len(str)-1]) + + return nil +} + +func (c *UserCredentialNamePassword) MarshalBinary() ([]byte, error) { + buf := new(bytes.Buffer) + + c.Body.NameLength = uint32(len(c.Name)) + c.Body.PasswordLength = uint32(len(c.Password)) + + _ = binary.Write(buf, binary.LittleEndian, &c.Body) + + src := append([]byte(c.Name+"\x00"), []byte(c.Password+"\x00")...) + + enc := base64.StdEncoding + pwd := make([]byte, enc.EncodedLen(len(src))) + enc.Encode(pwd, src) + _, _ = buf.Write(pwd) + _ = buf.WriteByte(0) + + return buf.Bytes(), nil +} diff --git a/vendor/github.com/vmware/govmomi/units/size.go b/vendor/github.com/vmware/govmomi/units/size.go new file mode 100644 index 00000000000..f4ee3fcfc8d --- /dev/null +++ b/vendor/github.com/vmware/govmomi/units/size.go @@ -0,0 +1,109 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package units + +import ( + "errors" + "fmt" + "regexp" + "strconv" +) + +type ByteSize int64 + +const ( + _ = iota + KB = 1 << (10 * iota) + MB + GB + TB + PB + EB +) + +func (b ByteSize) String() string { + switch { + case b >= EB: + return fmt.Sprintf("%.1fEB", float32(b)/EB) + case b >= PB: + return fmt.Sprintf("%.1fPB", float32(b)/PB) + case b >= TB: + return fmt.Sprintf("%.1fTB", float32(b)/TB) + case b >= GB: + return fmt.Sprintf("%.1fGB", float32(b)/GB) + case b >= MB: + return fmt.Sprintf("%.1fMB", float32(b)/MB) + case b >= KB: + return fmt.Sprintf("%.1fKB", float32(b)/KB) + } + return fmt.Sprintf("%dB", b) +} + +type FileSize int64 + +func (b FileSize) String() string { + switch { + case b >= EB: + return fmt.Sprintf("%.1fE", float32(b)/EB) + case b >= PB: + return fmt.Sprintf("%.1fP", float32(b)/PB) + case b >= TB: + return fmt.Sprintf("%.1fT", float32(b)/TB) + case b >= GB: + return fmt.Sprintf("%.1fG", float32(b)/GB) + case b >= MB: + return fmt.Sprintf("%.1fM", float32(b)/MB) + case b >= KB: + return fmt.Sprintf("%.1fK", float32(b)/KB) + } + return fmt.Sprintf("%d", b) +} + +var bytesRegexp = regexp.MustCompile(`^(?i)(\d+)([BKMGTPE]?)(ib|b)?$`) + +func (b *ByteSize) Set(s string) error { + m := bytesRegexp.FindStringSubmatch(s) + if len(m) == 0 { + return errors.New("invalid byte value") + } + + i, err := strconv.ParseInt(m[1], 10, 64) + if err != nil { + return err + } + *b = ByteSize(i) + + switch m[2] { + case "B", "b", "": + case "K", "k": + *b *= ByteSize(KB) + case "M", "m": + *b *= ByteSize(MB) + case "G", "g": + *b *= ByteSize(GB) + case "T", "t": + *b *= ByteSize(TB) + case "P", "p": + *b *= ByteSize(PB) + case "E", "e": + *b *= ByteSize(EB) + default: + return errors.New("invalid byte suffix") + } + + return nil +} diff --git a/vendor/github.com/vmware/govmomi/vapi/doc.go b/vendor/github.com/vmware/govmomi/vapi/doc.go new file mode 100644 index 00000000000..3ec8093522a --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/doc.go @@ -0,0 +1,21 @@ +/* +Copyright (c) 2018 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +/* +Package vapi provides access to vSphere Automation APIs that are not available in the SOAP API, +such as tagging and the content library. +*/ +package vapi diff --git a/vendor/github.com/vmware/govmomi/vapi/internal/internal.go b/vendor/github.com/vmware/govmomi/vapi/internal/internal.go index 78129994723..f6584c569bf 100644 --- a/vendor/github.com/vmware/govmomi/vapi/internal/internal.go +++ b/vendor/github.com/vmware/govmomi/vapi/internal/internal.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2018-2022 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,23 +17,36 @@ limitations under the License. package internal import ( - "bytes" - "encoding/json" - "io" - "net/http" - "net/url" - "github.com/vmware/govmomi/vim25/mo" "github.com/vmware/govmomi/vim25/types" ) +// VAPI REST Paths const ( - Path = "/rest/com/vmware" - SessionPath = "/cis/session" - CategoryPath = "/cis/tagging/category" - TagPath = "/cis/tagging/tag" - AssociationPath = "/cis/tagging/tag-association" - SessionCookieName = "vmware-api-session-id" + SessionPath = "/com/vmware/cis/session" + CategoryPath = "/com/vmware/cis/tagging/category" + TagPath = "/com/vmware/cis/tagging/tag" + AssociationPath = "/com/vmware/cis/tagging/tag-association" + LibraryPath = "/com/vmware/content/library" + LibraryItemFileData = "/com/vmware/cis/data" + LibraryItemPath = "/com/vmware/content/library/item" + LibraryItemFilePath = "/com/vmware/content/library/item/file" + LibraryItemUpdateSession = "/com/vmware/content/library/item/update-session" + LibraryItemUpdateSessionFile = "/com/vmware/content/library/item/updatesession/file" + LibraryItemDownloadSession = "/com/vmware/content/library/item/download-session" + LibraryItemDownloadSessionFile = "/com/vmware/content/library/item/downloadsession/file" + LocalLibraryPath = "/com/vmware/content/local-library" + SubscribedLibraryPath = "/com/vmware/content/subscribed-library" + SecurityPoliciesPath = "/api/content/security-policies" + SubscribedLibraryItem = "/com/vmware/content/library/subscribed-item" + Subscriptions = "/com/vmware/content/library/subscriptions" + TrustedCertificatesPath = "/api/content/trusted-certificates" + VCenterOVFLibraryItem = "/com/vmware/vcenter/ovf/library-item" + VCenterVMTXLibraryItem = "/vcenter/vm-template/library-items" + VCenterVM = "/vcenter/vm" + SessionCookieName = "vmware-api-session-id" + UseHeaderAuthn = "vmware-use-header-authn" + DebugEcho = "/vc-sim/debug/echo" ) // AssociatedObject is the same structure as types.ManagedObjectReference, @@ -62,63 +75,15 @@ func NewAssociation(ref mo.Reference) Association { } } -type CloneURL interface { - URL() *url.URL +type SubscriptionDestination struct { + ID string `json:"subscription"` } -// Resource wraps url.URL with helpers -type Resource struct { - u *url.URL +type SubscriptionDestinationSpec struct { + Subscriptions []SubscriptionDestination `json:"subscriptions,omitempty"` } -func URL(c CloneURL, path string) *Resource { - r := &Resource{u: c.URL()} - r.u.Path = Path + path - return r -} - -// WithID appends id to the URL.Path -func (r *Resource) WithID(id string) *Resource { - r.u.Path += "/id:" + id - return r -} - -// WithAction sets adds action to the URL.RawQuery -func (r *Resource) WithAction(action string) *Resource { - r.u.RawQuery = url.Values{ - "~action": []string{action}, - }.Encode() - return r -} - -// Request returns a new http.Request for the given method. -// An optional body can be provided for POST and PATCH methods. -func (r *Resource) Request(method string, body ...interface{}) *http.Request { - rdr := io.MultiReader() // empty body by default - if len(body) != 0 { - rdr = encode(body[0]) - } - req, err := http.NewRequest(method, r.u.String(), rdr) - if err != nil { - panic(err) - } - return req -} - -type errorReader struct { - e error -} - -func (e errorReader) Read([]byte) (int, error) { - return -1, e.e -} - -// encode body as JSON, deferring any errors until io.Reader is used. -func encode(body interface{}) io.Reader { - var b bytes.Buffer - err := json.NewEncoder(&b).Encode(body) - if err != nil { - return errorReader{err} - } - return &b +type SubscriptionItemDestinationSpec struct { + Force bool `json:"force_sync_content"` + Subscriptions []SubscriptionDestination `json:"subscriptions,omitempty"` } diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library.go b/vendor/github.com/vmware/govmomi/vapi/library/library.go new file mode 100644 index 00000000000..e5e5d0896f6 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/library.go @@ -0,0 +1,324 @@ +/* +Copyright (c) 2018 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package library + +import ( + "context" + "fmt" + "net/http" + "net/url" + "time" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vapi/internal" + "github.com/vmware/govmomi/vapi/rest" +) + +// StorageBackings for Content Libraries +type StorageBackings struct { + DatastoreID string `json:"datastore_id,omitempty"` + Type string `json:"type,omitempty"` +} + +// Library provides methods to create, read, update, delete, and enumerate libraries. +type Library struct { + CreationTime *time.Time `json:"creation_time,omitempty"` + Description string `json:"description,omitempty"` + ID string `json:"id,omitempty"` + LastModifiedTime *time.Time `json:"last_modified_time,omitempty"` + LastSyncTime *time.Time `json:"last_sync_time,omitempty"` + Name string `json:"name,omitempty"` + Storage []StorageBackings `json:"storage_backings,omitempty"` + Type string `json:"type,omitempty"` + Version string `json:"version,omitempty"` + Subscription *Subscription `json:"subscription_info,omitempty"` + Publication *Publication `json:"publish_info,omitempty"` + SecurityPolicyID string `json:"security_policy_id,omitempty"` + UnsetSecurityPolicyID bool `json:"unset_security_policy_id,omitempty"` +} + +// Subscription info +type Subscription struct { + AuthenticationMethod string `json:"authentication_method"` + AutomaticSyncEnabled *bool `json:"automatic_sync_enabled,omitempty"` + OnDemand *bool `json:"on_demand,omitempty"` + Password string `json:"password,omitempty"` + SslThumbprint string `json:"ssl_thumbprint,omitempty"` + SubscriptionURL string `json:"subscription_url,omitempty"` + UserName string `json:"user_name,omitempty"` +} + +// Publication info +type Publication struct { + AuthenticationMethod string `json:"authentication_method"` + UserName string `json:"user_name,omitempty"` + Password string `json:"password,omitempty"` + CurrentPassword string `json:"current_password,omitempty"` + PersistJSON *bool `json:"persist_json_enabled,omitempty"` + Published *bool `json:"published,omitempty"` + PublishURL string `json:"publish_url,omitempty"` +} + +// SubscriberSummary as returned by ListSubscribers +type SubscriberSummary struct { + LibraryID string `json:"subscribed_library"` + LibraryName string `json:"subscribed_library_name"` + SubscriptionID string `json:"subscription"` + LibraryVcenterHostname string `json:"subscribed_library_vcenter_hostname,omitempty"` +} + +// Placement information used to place a virtual machine template +type Placement struct { + ResourcePool string `json:"resource_pool,omitempty"` + Host string `json:"host,omitempty"` + Folder string `json:"folder,omitempty"` + Cluster string `json:"cluster,omitempty"` + Network string `json:"network,omitempty"` +} + +// Vcenter contains information about the vCenter Server instance where a subscribed library associated with a subscription exists. +type Vcenter struct { + Hostname string `json:"hostname"` + Port int `json:"https_port,omitempty"` + ServerGUID string `json:"server_guid"` +} + +// Subscriber contains the detailed info for a library subscriber. +type Subscriber struct { + LibraryID string `json:"subscribed_library"` + LibraryName string `json:"subscribed_library_name"` + LibraryLocation string `json:"subscribed_library_location"` + Placement *Placement `json:"subscribed_library_placement,omitempty"` + Vcenter *Vcenter `json:"subscribed_library_vcenter,omitempty"` +} + +// SubscriberLibrary is the specification for a subscribed library to be associated with a subscription. +type SubscriberLibrary struct { + Target string `json:"target"` + LibraryID string `json:"subscribed_library,omitempty"` + Location string `json:"location"` + Vcenter *Vcenter `json:"vcenter,omitempty"` + Placement *Placement `json:"placement,omitempty"` +} + +// Patch merges updates from the given src. +func (l *Library) Patch(src *Library) { + if src.Name != "" { + l.Name = src.Name + } + if src.Description != "" { + l.Description = src.Description + } + if src.Version != "" { + l.Version = src.Version + } +} + +// Manager extends rest.Client, adding content library related methods. +type Manager struct { + *rest.Client +} + +// NewManager creates a new Manager instance with the given client. +func NewManager(client *rest.Client) *Manager { + return &Manager{ + Client: client, + } +} + +// Find is the search criteria for finding libraries. +type Find struct { + Name string `json:"name,omitempty"` + Type string `json:"type,omitempty"` +} + +// FindLibrary returns one or more libraries that match the provided search +// criteria. +// +// The provided name is case-insensitive. +// +// Either the name or type of library may be set to empty values in order +// to search for all libraries, all libraries with a specific name, regardless +// of type, or all libraries of a specified type. +func (c *Manager) FindLibrary(ctx context.Context, search Find) ([]string, error) { + url := c.Resource(internal.LibraryPath).WithAction("find") + spec := struct { + Spec Find `json:"spec"` + }{search} + var res []string + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// CreateLibrary creates a new library with the given Type, Name, +// Description, and CategoryID. +func (c *Manager) CreateLibrary(ctx context.Context, library Library) (string, error) { + spec := struct { + Library Library `json:"create_spec"` + }{library} + path := internal.LocalLibraryPath + if library.Type == "SUBSCRIBED" { + path = internal.SubscribedLibraryPath + sub := library.Subscription + u, err := url.Parse(sub.SubscriptionURL) + if err != nil { + return "", err + } + if u.Scheme == "https" && sub.SslThumbprint == "" { + thumbprint := c.Thumbprint(u.Host) + if thumbprint == "" { + t := c.DefaultTransport() + if t.TLSClientConfig.InsecureSkipVerify { + var info object.HostCertificateInfo + _ = info.FromURL(u, t.TLSClientConfig) + thumbprint = info.ThumbprintSHA1 + } + sub.SslThumbprint = thumbprint + } + } + } + url := c.Resource(path) + var res string + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// SyncLibrary syncs a subscribed library. +func (c *Manager) SyncLibrary(ctx context.Context, library *Library) error { + path := internal.SubscribedLibraryPath + url := c.Resource(path).WithID(library.ID).WithAction("sync") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} + +// PublishLibrary publishes the library to specified subscriptions. +// If no subscriptions are specified, then publishes the library to all subscriptions. +func (c *Manager) PublishLibrary(ctx context.Context, library *Library, subscriptions []string) error { + path := internal.LocalLibraryPath + var spec internal.SubscriptionDestinationSpec + for i := range subscriptions { + spec.Subscriptions = append(spec.Subscriptions, internal.SubscriptionDestination{ID: subscriptions[i]}) + } + url := c.Resource(path).WithID(library.ID).WithAction("publish") + 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 + if library.Type == "SUBSCRIBED" { + path = internal.SubscribedLibraryPath + } + url := c.Resource(path).WithID(library.ID) + return c.Do(ctx, url.Request(http.MethodDelete), nil) +} + +// ListLibraries returns a list of all content library IDs in the system. +func (c *Manager) ListLibraries(ctx context.Context) ([]string, error) { + url := c.Resource(internal.LibraryPath) + var res []string + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// GetLibraryByID returns information on a library for the given ID. +func (c *Manager) GetLibraryByID(ctx context.Context, id string) (*Library, error) { + url := c.Resource(internal.LibraryPath).WithID(id) + var res Library + return &res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// GetLibraryByName returns information on a library for the given name. +func (c *Manager) GetLibraryByName(ctx context.Context, name string) (*Library, error) { + // Lookup by name + libraries, err := c.GetLibraries(ctx) + if err != nil { + return nil, err + } + for i := range libraries { + if libraries[i].Name == name { + return &libraries[i], nil + } + } + return nil, fmt.Errorf("library name (%s) not found", name) +} + +// GetLibraries returns a list of all content library details in the system. +func (c *Manager) GetLibraries(ctx context.Context) ([]Library, error) { + ids, err := c.ListLibraries(ctx) + if err != nil { + return nil, fmt.Errorf("get libraries failed for: %s", err) + } + + var libraries []Library + for _, id := range ids { + library, err := c.GetLibraryByID(ctx, id) + if err != nil { + return nil, fmt.Errorf("get library %s failed for %s", id, err) + } + + libraries = append(libraries, *library) + + } + return libraries, nil +} + +// ListSubscribers lists the subscriptions of the published library. +func (c *Manager) ListSubscribers(ctx context.Context, library *Library) ([]SubscriberSummary, error) { + url := c.Resource(internal.Subscriptions).WithParam("library", library.ID) + var res []SubscriberSummary + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// CreateSubscriber creates a subscription of the published library. +func (c *Manager) CreateSubscriber(ctx context.Context, library *Library, s SubscriberLibrary) (string, error) { + var spec struct { + Sub struct { + SubscriberLibrary SubscriberLibrary `json:"subscribed_library"` + } `json:"spec"` + } + spec.Sub.SubscriberLibrary = s + url := c.Resource(internal.Subscriptions).WithID(library.ID) + var res string + return res, c.Do(ctx, url.Request(http.MethodPost, &spec), &res) +} + +// GetSubscriber returns information about the specified subscriber of the published library. +func (c *Manager) GetSubscriber(ctx context.Context, library *Library, subscriber string) (*Subscriber, error) { + id := internal.SubscriptionDestination{ID: subscriber} + url := c.Resource(internal.Subscriptions).WithID(library.ID).WithAction("get") + var res Subscriber + return &res, c.Do(ctx, url.Request(http.MethodPost, &id), &res) +} + +// DeleteSubscriber deletes the specified subscription of the published library. +// The subscribed library associated with the subscription will not be deleted. +func (c *Manager) DeleteSubscriber(ctx context.Context, library *Library, subscriber string) error { + id := internal.SubscriptionDestination{ID: subscriber} + url := c.Resource(internal.Subscriptions).WithID(library.ID).WithAction("delete") + return c.Do(ctx, url.Request(http.MethodPost, &id), nil) +} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_file.go b/vendor/github.com/vmware/govmomi/vapi/library/library_file.go new file mode 100644 index 00000000000..ba71d72d258 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/library_file.go @@ -0,0 +1,56 @@ +/* +Copyright (c) 2018 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package library + +import ( + "context" + "net/http" + + "github.com/vmware/govmomi/vapi/internal" +) + +// Checksum provides checksum information on library item files. +type Checksum struct { + Algorithm string `json:"algorithm,omitempty"` + Checksum string `json:"checksum"` +} + +// File provides methods to get information on library item files. +type File struct { + Cached *bool `json:"cached,omitempty"` + Checksum *Checksum `json:"checksum_info,omitempty"` + Name string `json:"name,omitempty"` + Size *int64 `json:"size,omitempty"` + Version string `json:"version,omitempty"` +} + +// ListLibraryItemFiles returns a list of all the files for a library item. +func (c *Manager) ListLibraryItemFiles(ctx context.Context, id string) ([]File, error) { + url := c.Resource(internal.LibraryItemFilePath).WithParam("library_item_id", id) + var res []File + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// GetLibraryItemFile returns a file with the provided name for a library item. +func (c *Manager) GetLibraryItemFile(ctx context.Context, id, fileName string) (*File, error) { + url := c.Resource(internal.LibraryItemFilePath).WithID(id).WithAction("get") + spec := struct { + Name string `json:"name"` + }{fileName} + var res File + return &res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_item.go b/vendor/github.com/vmware/govmomi/vapi/library/library_item.go new file mode 100644 index 00000000000..adc2101ab1e --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/library_item.go @@ -0,0 +1,203 @@ +/* +Copyright (c) 2018-2022 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package library + +import ( + "context" + "fmt" + "net/http" + "time" + + "github.com/vmware/govmomi/vapi/internal" +) + +const ( + ItemTypeISO = "iso" + ItemTypeOVF = "ovf" + ItemTypeVMTX = "vm-template" +) + +// Item provides methods to create, read, update, delete, and enumerate library items. +type Item struct { + Cached bool `json:"cached,omitempty"` + ContentVersion string `json:"content_version,omitempty"` + CreationTime *time.Time `json:"creation_time,omitempty"` + Description string `json:"description,omitempty"` + ID string `json:"id,omitempty"` + LastModifiedTime *time.Time `json:"last_modified_time,omitempty"` + LastSyncTime *time.Time `json:"last_sync_time,omitempty"` + LibraryID string `json:"library_id,omitempty"` + MetadataVersion string `json:"metadata_version,omitempty"` + Name string `json:"name,omitempty"` + Size int64 `json:"size,omitempty"` + SourceID string `json:"source_id,omitempty"` + Type string `json:"type,omitempty"` + Version string `json:"version,omitempty"` + + SecurityCompliance *bool `json:"security_compliance,omitempty"` + CertificateVerification *ItemCertificateVerification `json:"certificate_verification_info,omitempty"` +} + +// ItemCertificateVerification contains the certificate verification status and item's signing certificate +type ItemCertificateVerification struct { + Status string `json:"status"` + CertChain []string `json:"cert_chain,omitempty"` +} + +// Patch merges updates from the given src. +func (i *Item) Patch(src *Item) { + if src.Name != "" { + i.Name = src.Name + } + if src.Description != "" { + i.Description = src.Description + } + if src.Type != "" { + i.Type = src.Type + } + if src.Version != "" { + i.Version = src.Version + } +} + +// CreateLibraryItem creates a new library item +func (c *Manager) CreateLibraryItem(ctx context.Context, item Item) (string, error) { + type createItemSpec struct { + Name string `json:"name"` + Description string `json:"description"` + LibraryID string `json:"library_id,omitempty"` + Type string `json:"type"` + } + spec := struct { + Item createItemSpec `json:"create_spec"` + }{ + Item: createItemSpec{ + Name: item.Name, + Description: item.Description, + LibraryID: item.LibraryID, + Type: item.Type, + }, + } + url := c.Resource(internal.LibraryItemPath) + var res string + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// CopyLibraryItem copies a library item +func (c *Manager) CopyLibraryItem(ctx context.Context, src *Item, dst Item) (string, error) { + body := struct { + Item `json:"destination_create_spec"` + }{dst} + url := c.Resource(internal.LibraryItemPath).WithID(src.ID).WithAction("copy") + var res string + return res, c.Do(ctx, url.Request(http.MethodPost, body), &res) +} + +// SyncLibraryItem syncs a subscribed library item +func (c *Manager) SyncLibraryItem(ctx context.Context, item *Item, force bool) error { + body := struct { + Force bool `json:"force_sync_content"` + }{force} + url := c.Resource(internal.SubscribedLibraryItem).WithID(item.ID).WithAction("sync") + return c.Do(ctx, url.Request(http.MethodPost, body), nil) +} + +// PublishLibraryItem publishes a library item to specified subscriptions. +// If no subscriptions are specified, then publishes the library item to all subscriptions. +func (c *Manager) PublishLibraryItem(ctx context.Context, item *Item, force bool, subscriptions []string) error { + body := internal.SubscriptionItemDestinationSpec{ + Force: force, + } + for i := range subscriptions { + body.Subscriptions = append(body.Subscriptions, internal.SubscriptionDestination{ID: subscriptions[i]}) + } + url := c.Resource(internal.LibraryItemPath).WithID(item.ID).WithAction("publish") + 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) + return c.Do(ctx, url.Request(http.MethodDelete), nil) +} + +// ListLibraryItems returns a list of all items in a content library. +func (c *Manager) ListLibraryItems(ctx context.Context, id string) ([]string, error) { + url := c.Resource(internal.LibraryItemPath).WithParam("library_id", id) + var res []string + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// GetLibraryItem returns information on a library item for the given ID. +func (c *Manager) GetLibraryItem(ctx context.Context, id string) (*Item, error) { + url := c.Resource(internal.LibraryItemPath).WithID(id) + var res Item + return &res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// GetLibraryItems returns a list of all the library items for the specified library. +func (c *Manager) GetLibraryItems(ctx context.Context, libraryID string) ([]Item, error) { + ids, err := c.ListLibraryItems(ctx, libraryID) + if err != nil { + return nil, fmt.Errorf("get library items failed for: %s", err) + } + var items []Item + for _, id := range ids { + item, err := c.GetLibraryItem(ctx, id) + if err != nil { + return nil, fmt.Errorf("get library item for %s failed for %s", id, err) + } + items = append(items, *item) + } + return items, nil +} + +// FindItem is the search criteria for finding library items. +type FindItem struct { + Cached *bool `json:"cached,omitempty"` + LibraryID string `json:"library_id,omitempty"` + Name string `json:"name,omitempty"` + SourceID string `json:"source_id,omitempty"` + Type string `json:"type,omitempty"` +} + +// FindLibraryItems returns the IDs of all the library items that match the +// search criteria. +func (c *Manager) FindLibraryItems( + ctx context.Context, search FindItem) ([]string, error) { + + url := c.Resource(internal.LibraryItemPath).WithAction("find") + spec := struct { + Spec FindItem `json:"spec"` + }{search} + var res []string + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_item_downloadsession_file.go b/vendor/github.com/vmware/govmomi/vapi/library/library_item_downloadsession_file.go new file mode 100644 index 00000000000..6f432f7279a --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/library_item_downloadsession_file.go @@ -0,0 +1,71 @@ +/* +Copyright (c) 2018 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package library + +import ( + "context" + "net/http" + + "github.com/vmware/govmomi/vapi/internal" + "github.com/vmware/govmomi/vapi/rest" +) + +// DownloadFile is the specification for the downloadsession +// operations file:add, file:get, and file:list. +type DownloadFile struct { + BytesTransferred int64 `json:"bytes_transferred"` + Checksum *Checksum `json:"checksum_info,omitempty"` + DownloadEndpoint *TransferEndpoint `json:"download_endpoint,omitempty"` + ErrorMessage *rest.LocalizableMessage `json:"error_message,omitempty"` + Name string `json:"name"` + Size int64 `json:"size,omitempty"` + Status string `json:"status"` +} + +// GetLibraryItemDownloadSessionFile retrieves information about a specific file that is a part of an download session. +func (c *Manager) GetLibraryItemDownloadSessionFile(ctx context.Context, sessionID string, name string) (*DownloadFile, error) { + url := c.Resource(internal.LibraryItemDownloadSessionFile).WithID(sessionID).WithAction("get") + spec := struct { + Name string `json:"file_name"` + }{name} + var res DownloadFile + err := c.Do(ctx, url.Request(http.MethodPost, spec), &res) + if err != nil { + return nil, err + } + if res.Status == "ERROR" { + return nil, res.ErrorMessage + } + return &res, nil +} + +// ListLibraryItemDownloadSessionFile retrieves information about a specific file that is a part of an download session. +func (c *Manager) ListLibraryItemDownloadSessionFile(ctx context.Context, sessionID string) ([]DownloadFile, error) { + url := c.Resource(internal.LibraryItemDownloadSessionFile).WithParam("download_session_id", sessionID) + var res []DownloadFile + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// PrepareLibraryItemDownloadSessionFile retrieves information about a specific file that is a part of an download session. +func (c *Manager) PrepareLibraryItemDownloadSessionFile(ctx context.Context, sessionID string, name string) (*DownloadFile, error) { + url := c.Resource(internal.LibraryItemDownloadSessionFile).WithID(sessionID).WithAction("prepare") + spec := struct { + Name string `json:"file_name"` + }{name} + var res DownloadFile + return &res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession.go b/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession.go new file mode 100644 index 00000000000..df66a87b375 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession.go @@ -0,0 +1,165 @@ +/* +Copyright (c) 2018 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package library + +import ( + "context" + "net/http" + "time" + + "github.com/vmware/govmomi/vapi/internal" + "github.com/vmware/govmomi/vapi/rest" +) + +// Session is used to create an initial update or download session +type Session struct { + ClientProgress int64 `json:"client_progress,omitempty"` + ErrorMessage *rest.LocalizableMessage `json:"error_message,omitempty"` + ExpirationTime *time.Time `json:"expiration_time,omitempty"` + ID string `json:"id,omitempty"` + LibraryItemContentVersion string `json:"library_item_content_version,omitempty"` + LibraryItemID string `json:"library_item_id,omitempty"` + State string `json:"state,omitempty"` +} + +// CreateLibraryItemUpdateSession creates a new library item +func (c *Manager) CreateLibraryItemUpdateSession(ctx context.Context, session Session) (string, error) { + url := c.Resource(internal.LibraryItemUpdateSession) + spec := struct { + CreateSpec Session `json:"create_spec"` + }{session} + var res string + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// GetLibraryItemUpdateSession gets the update session information with status +func (c *Manager) GetLibraryItemUpdateSession(ctx context.Context, id string) (*Session, error) { + url := c.Resource(internal.LibraryItemUpdateSession).WithID(id) + var res Session + return &res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// ListLibraryItemUpdateSession gets the list of update sessions +func (c *Manager) ListLibraryItemUpdateSession(ctx context.Context) ([]string, error) { + url := c.Resource(internal.LibraryItemUpdateSession) + var res []string + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// CancelLibraryItemUpdateSession cancels an update session +func (c *Manager) CancelLibraryItemUpdateSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemUpdateSession).WithID(id).WithAction("cancel") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} + +// CompleteLibraryItemUpdateSession completes an update session +func (c *Manager) CompleteLibraryItemUpdateSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemUpdateSession).WithID(id).WithAction("complete") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} + +// DeleteLibraryItemUpdateSession deletes an update session +func (c *Manager) DeleteLibraryItemUpdateSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemUpdateSession).WithID(id) + return c.Do(ctx, url.Request(http.MethodDelete), nil) +} + +// FailLibraryItemUpdateSession fails an update session +func (c *Manager) FailLibraryItemUpdateSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemUpdateSession).WithID(id).WithAction("fail") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} + +// KeepAliveLibraryItemUpdateSession keeps an inactive update session alive. +func (c *Manager) KeepAliveLibraryItemUpdateSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemUpdateSession).WithID(id).WithAction("keep-alive") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} + +// WaitOnLibraryItemUpdateSession blocks until the update session is no longer +// in the ACTIVE state. +func (c *Manager) WaitOnLibraryItemUpdateSession( + ctx context.Context, sessionID string, + interval time.Duration, intervalCallback func()) error { + + // Wait until the upload operation is complete to return. + for { + session, err := c.GetLibraryItemUpdateSession(ctx, sessionID) + if err != nil { + return err + } + + if session.State != "ACTIVE" { + if session.State == "ERROR" { + return session.ErrorMessage + } + return nil + } + time.Sleep(interval) + if intervalCallback != nil { + intervalCallback() + } + } +} + +// CreateLibraryItemDownloadSession creates a new library item +func (c *Manager) CreateLibraryItemDownloadSession(ctx context.Context, session Session) (string, error) { + url := c.Resource(internal.LibraryItemDownloadSession) + spec := struct { + CreateSpec Session `json:"create_spec"` + }{session} + var res string + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// GetLibraryItemDownloadSession gets the download session information with status +func (c *Manager) GetLibraryItemDownloadSession(ctx context.Context, id string) (*Session, error) { + url := c.Resource(internal.LibraryItemDownloadSession).WithID(id) + var res Session + return &res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// ListLibraryItemDownloadSession gets the list of download sessions +func (c *Manager) ListLibraryItemDownloadSession(ctx context.Context) ([]string, error) { + url := c.Resource(internal.LibraryItemDownloadSession) + var res []string + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +// CancelLibraryItemDownloadSession cancels an download session +func (c *Manager) CancelLibraryItemDownloadSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemDownloadSession).WithID(id).WithAction("cancel") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} + +// DeleteLibraryItemDownloadSession deletes an download session +func (c *Manager) DeleteLibraryItemDownloadSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemDownloadSession).WithID(id) + return c.Do(ctx, url.Request(http.MethodDelete), nil) +} + +// FailLibraryItemDownloadSession fails an download session +func (c *Manager) FailLibraryItemDownloadSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemDownloadSession).WithID(id).WithAction("fail") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} + +// KeepAliveLibraryItemDownloadSession keeps an inactive download session alive. +func (c *Manager) KeepAliveLibraryItemDownloadSession(ctx context.Context, id string) error { + url := c.Resource(internal.LibraryItemDownloadSession).WithID(id).WithAction("keep-alive") + return c.Do(ctx, url.Request(http.MethodPost), nil) +} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession_file.go b/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession_file.go new file mode 100644 index 00000000000..e34331cfa57 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/library_item_updatesession_file.go @@ -0,0 +1,149 @@ +/* +Copyright (c) 2018 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package library + +import ( + "bufio" + "context" + "io" + "net/http" + "strings" + + "github.com/vmware/govmomi/vapi/internal" + "github.com/vmware/govmomi/vapi/rest" + "github.com/vmware/govmomi/vim25/soap" +) + +// TransferEndpoint provides information on the source of a library item file. +type TransferEndpoint struct { + URI string `json:"uri,omitempty"` + SSLCertificateThumbprint string `json:"ssl_certificate_thumbprint,omitempty"` +} + +// UpdateFile is the specification for the updatesession +// operations file:add, file:get, and file:list. +type UpdateFile struct { + BytesTransferred int64 `json:"bytes_transferred,omitempty"` + Checksum *Checksum `json:"checksum_info,omitempty"` + ErrorMessage *rest.LocalizableMessage `json:"error_message,omitempty"` + Name string `json:"name"` + Size int64 `json:"size,omitempty"` + SourceEndpoint *TransferEndpoint `json:"source_endpoint,omitempty"` + SourceType string `json:"source_type"` + Status string `json:"status,omitempty"` + UploadEndpoint *TransferEndpoint `json:"upload_endpoint,omitempty"` +} + +// AddLibraryItemFile adds a file +func (c *Manager) AddLibraryItemFile(ctx context.Context, sessionID string, updateFile UpdateFile) (*UpdateFile, error) { + url := c.Resource(internal.LibraryItemUpdateSessionFile).WithID(sessionID).WithAction("add") + spec := struct { + FileSpec UpdateFile `json:"file_spec"` + }{updateFile} + var res UpdateFile + err := c.Do(ctx, url.Request(http.MethodPost, spec), &res) + if err != nil { + return nil, err + } + if res.Status == "ERROR" { + return nil, res.ErrorMessage + } + return &res, nil +} + +// AddLibraryItemFileFromURI adds a file from a remote URI. +func (c *Manager) AddLibraryItemFileFromURI( + ctx context.Context, + sessionID, fileName, uri string) (*UpdateFile, error) { + + n, fingerprint, err := c.getContentLengthAndFingerprint(ctx, uri) + if err != nil { + return nil, err + } + + info, err := c.AddLibraryItemFile(ctx, sessionID, UpdateFile{ + Name: fileName, + SourceType: "PULL", + Size: n, + SourceEndpoint: &TransferEndpoint{ + URI: uri, + SSLCertificateThumbprint: fingerprint, + }, + }) + if err != nil { + return nil, err + } + + return info, c.CompleteLibraryItemUpdateSession(ctx, sessionID) +} + +// GetLibraryItemUpdateSessionFile retrieves information about a specific file +// that is a part of an update session. +func (c *Manager) GetLibraryItemUpdateSessionFile(ctx context.Context, sessionID string, fileName string) (*UpdateFile, error) { + url := c.Resource(internal.LibraryItemUpdateSessionFile).WithID(sessionID).WithAction("get") + spec := struct { + Name string `json:"file_name"` + }{fileName} + var res UpdateFile + return &res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// getContentLengthAndFingerprint gets the number of bytes returned +// by the URI as well as the SHA1 fingerprint of the peer certificate +// if the URI's scheme is https. +func (c *Manager) getContentLengthAndFingerprint( + ctx context.Context, uri string) (int64, string, error) { + resp, err := c.Head(uri) + if err != nil { + return 0, "", err + } + if resp.TLS == nil || len(resp.TLS.PeerCertificates) == 0 { + return resp.ContentLength, "", nil + } + fingerprint := c.Thumbprint(resp.Request.URL.Host) + if fingerprint == "" { + if c.DefaultTransport().TLSClientConfig.InsecureSkipVerify { + fingerprint = soap.ThumbprintSHA1(resp.TLS.PeerCertificates[0]) + } + } + return resp.ContentLength, fingerprint, nil +} + +// ReadManifest converts an ovf manifest to a map of file name -> Checksum. +func ReadManifest(m io.Reader) (map[string]*Checksum, error) { + // expected format: openssl sha1 *.{ovf,vmdk} + c := make(map[string]*Checksum) + + scanner := bufio.NewScanner(m) + for scanner.Scan() { + line := strings.SplitN(scanner.Text(), ")=", 2) + if len(line) != 2 { + continue + } + name := strings.SplitN(line[0], "(", 2) + if len(name) != 2 { + continue + } + sum := &Checksum{ + Algorithm: strings.TrimSpace(name[0]), + Checksum: strings.TrimSpace(line[1]), + } + c[name[1]] = sum + } + + return c, scanner.Err() +} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/security_policy.go b/vendor/github.com/vmware/govmomi/vapi/library/security_policy.go new file mode 100644 index 00000000000..dd476635682 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/security_policy.go @@ -0,0 +1,63 @@ +/* +Copyright (c) 2022-2022 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package library + +import ( + "context" + "errors" + "net/http" + + "github.com/vmware/govmomi/vapi/internal" +) + +const ( + OvfDefaultSecurityPolicy = "OVF default policy" +) + +// ContentSecurityPoliciesInfo contains information on security policies that can +// be used to describe security for content library items. +type ContentSecurityPoliciesInfo struct { + // ItemTypeRules are rules governing the policy. + ItemTypeRules map[string]string `json:"item_type_rules"` + // Name is a human-readable identifier identifying the policy. + Name string `json:"name"` + // Policy is the unique identifier for a policy. + Policy string `json:"policy"` +} + +// ListSecurityPolicies lists security policies +func (c *Manager) ListSecurityPolicies(ctx context.Context) ([]ContentSecurityPoliciesInfo, error) { + url := c.Resource(internal.SecurityPoliciesPath) + var res []ContentSecurityPoliciesInfo + return res, c.Do(ctx, url.Request(http.MethodGet), &res) +} + +func (c *Manager) DefaultOvfSecurityPolicy(ctx context.Context) (string, error) { + res, err := c.ListSecurityPolicies(ctx) + + if err != nil { + return "", err + } + + for _, policy := range res { + if policy.Name == OvfDefaultSecurityPolicy { + return policy.Policy, nil + } + } + + return "", errors.New("failed to find default ovf security policy") +} diff --git a/vendor/github.com/vmware/govmomi/vapi/library/trusted_certificates.go b/vendor/github.com/vmware/govmomi/vapi/library/trusted_certificates.go new file mode 100644 index 00000000000..33e25a065f9 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/library/trusted_certificates.go @@ -0,0 +1,70 @@ +/* +Copyright (c) 2022-2022 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package library + +import ( + "context" + "net/http" + "path" + + "github.com/vmware/govmomi/vapi/internal" +) + +// TrustedCertificate contains a trusted certificate in Base64 encoded PEM format +type TrustedCertificate struct { + Text string `json:"cert_text"` +} + +// TrustedCertificateSummary contains a trusted certificate in Base64 encoded PEM format and its id +type TrustedCertificateSummary struct { + TrustedCertificate + ID string `json:"certificate"` +} + +// ListTrustedCertificates retrieves all content library's trusted certificates +func (c *Manager) ListTrustedCertificates(ctx context.Context) ([]TrustedCertificateSummary, error) { + url := c.Resource(internal.TrustedCertificatesPath) + var res struct { + Certificates []TrustedCertificateSummary `json:"certificates"` + } + err := c.Do(ctx, url.Request(http.MethodGet), &res) + return res.Certificates, err +} + +// GetTrustedCertificate retrieves a trusted certificate for a given certificate id +func (c *Manager) GetTrustedCertificate(ctx context.Context, id string) (*TrustedCertificate, error) { + url := c.Resource(path.Join(internal.TrustedCertificatesPath, id)) + var res TrustedCertificate + err := c.Do(ctx, url.Request(http.MethodGet), &res) + if err != nil { + return nil, err + } + return &res, nil +} + +// CreateTrustedCertificate adds a certificate to content library trust store +func (c *Manager) CreateTrustedCertificate(ctx context.Context, cert string) error { + url := c.Resource(internal.TrustedCertificatesPath) + body := TrustedCertificate{Text: cert} + return c.Do(ctx, url.Request(http.MethodPost, body), nil) +} + +// DeleteTrustedCertificate deletes the trusted certificate from content library's trust store for the given id +func (c *Manager) DeleteTrustedCertificate(ctx context.Context, id string) error { + url := c.Resource(path.Join(internal.TrustedCertificatesPath, id)) + return c.Do(ctx, url.Request(http.MethodDelete), nil) +} diff --git a/vendor/github.com/vmware/govmomi/vapi/resource.go b/vendor/github.com/vmware/govmomi/vapi/resource.go new file mode 100644 index 00000000000..5fb935dd8ef --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/resource.go @@ -0,0 +1,22 @@ +/* +Copyright (c) 2022-2022 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vapi + +const ( + // Path is the new-style endpoint for API resources. It supersedes /rest. + Path = "/api" +) diff --git a/vendor/github.com/vmware/govmomi/vapi/rest/client.go b/vendor/github.com/vmware/govmomi/vapi/rest/client.go index 152928ee220..b1cefd0e280 100644 --- a/vendor/github.com/vmware/govmomi/vapi/rest/client.go +++ b/vendor/github.com/vmware/govmomi/vapi/rest/client.go @@ -25,6 +25,9 @@ import ( "io/ioutil" "net/http" "net/url" + "strings" + "sync" + "time" "github.com/vmware/govmomi/vapi/internal" "github.com/vmware/govmomi/vim25" @@ -33,14 +36,93 @@ import ( // Client extends soap.Client to support JSON encoding, while inheriting security features, debug tracing and session persistence. type Client struct { + mu sync.Mutex + *soap.Client + sessionID string +} + +// Session information +type Session struct { + User string `json:"user"` + Created time.Time `json:"created_time"` + LastAccessed time.Time `json:"last_accessed_time"` +} + +// LocalizableMessage represents a localizable error +type LocalizableMessage struct { + Args []string `json:"args,omitempty"` + DefaultMessage string `json:"default_message,omitempty"` + ID string `json:"id,omitempty"` +} + +func (m *LocalizableMessage) Error() string { + return m.DefaultMessage } // NewClient creates a new Client instance. func NewClient(c *vim25.Client) *Client { - sc := c.Client.NewServiceClient(internal.Path, "") + sc := c.Client.NewServiceClient(Path, "") - return &Client{sc} + return &Client{Client: sc} +} + +// SessionID is set by calling Login() or optionally with the given id param +func (c *Client) SessionID(id ...string) string { + c.mu.Lock() + defer c.mu.Unlock() + if len(id) != 0 { + c.sessionID = id[0] + } + return c.sessionID +} + +type marshaledClient struct { + SoapClient *soap.Client + SessionID string +} + +func (c *Client) MarshalJSON() ([]byte, error) { + m := marshaledClient{ + SoapClient: c.Client, + SessionID: c.sessionID, + } + + return json.Marshal(m) +} + +func (c *Client) UnmarshalJSON(b []byte) error { + var m marshaledClient + + err := json.Unmarshal(b, &m) + if err != nil { + return err + } + + *c = Client{ + Client: m.SoapClient, + sessionID: m.SessionID, + } + + 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()} + if !isAPI(path) { + path = Path + path + } + r.u.Path = path + return r } type Signer interface { @@ -53,24 +135,64 @@ func (c *Client) WithSigner(ctx context.Context, s Signer) context.Context { return context.WithValue(ctx, signerContext{}, s) } +type headersContext struct{} + +// WithHeader returns a new Context populated with the provided headers map. +// Calls to a VAPI REST client with this context will populate the HTTP headers +// map using the provided headers. +func (c *Client) WithHeader( + ctx context.Context, + headers http.Header) context.Context { + + return context.WithValue(ctx, headersContext{}, headers) +} + +type statusError struct { + res *http.Response +} + +func (e *statusError) Error() string { + return fmt.Sprintf("%s %s: %s", e.res.Request.Method, e.res.Request.URL, e.res.Status) +} + +// RawResponse may be used with the Do method as the resBody argument in order +// to capture the raw response data. +type RawResponse struct { + bytes.Buffer +} + // Do sends the http.Request, decoding resBody if provided. func (c *Client) Do(ctx context.Context, req *http.Request, resBody interface{}) error { switch req.Method { - case http.MethodPost, http.MethodPatch: + case http.MethodPost, http.MethodPatch, http.MethodPut: req.Header.Set("Content-Type", "application/json") } req.Header.Set("Accept", "application/json") + if id := c.SessionID(); id != "" { + req.Header.Set(internal.SessionCookieName, id) + } + if s, ok := ctx.Value(signerContext{}).(Signer); ok { if err := s.SignRequest(req); err != nil { return err } } + if headers, ok := ctx.Value(headersContext{}).(http.Header); ok { + for k, v := range headers { + for _, v := range v { + req.Header.Add(k, v) + } + } + } + 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 detail, err := ioutil.ReadAll(res.Body) @@ -79,7 +201,7 @@ func (c *Client) Do(ctx context.Context, req *http.Request, resBody interface{}) } return fmt.Errorf("%s: %s", res.Status, bytes.TrimSpace(detail)) default: - return fmt.Errorf("%s %s: %s", req.Method, req.URL, res.Status) + return &statusError{res} } if resBody == nil { @@ -87,23 +209,68 @@ func (c *Client) Do(ctx context.Context, req *http.Request, resBody interface{}) } switch b := resBody.(type) { + case *RawResponse: + return res.Write(b) case io.Writer: _, 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) } }) } +// authHeaders ensures the given map contains a REST auth header +func (c *Client) authHeaders(h map[string]string) map[string]string { + if _, exists := h[internal.SessionCookieName]; exists { + return h + } + if h == nil { + h = make(map[string]string) + } + + h[internal.SessionCookieName] = c.SessionID() + + return h +} + +// Download wraps soap.Client.Download, adding the REST authentication header +func (c *Client) Download(ctx context.Context, u *url.URL, param *soap.Download) (io.ReadCloser, int64, error) { + p := *param + p.Headers = c.authHeaders(p.Headers) + return c.Client.Download(ctx, u, &p) +} + +// DownloadFile wraps soap.Client.DownloadFile, adding the REST authentication header +func (c *Client) DownloadFile(ctx context.Context, file string, u *url.URL, param *soap.Download) error { + p := *param + p.Headers = c.authHeaders(p.Headers) + return c.Client.DownloadFile(ctx, file, u, &p) +} + +// Upload wraps soap.Client.Upload, adding the REST authentication header +func (c *Client) Upload(ctx context.Context, f io.Reader, u *url.URL, param *soap.Upload) error { + p := *param + p.Headers = c.authHeaders(p.Headers) + return c.Client.Upload(ctx, f, u, &p) +} + // Login creates a new session via Basic Authentication with the given url.Userinfo. func (c *Client) Login(ctx context.Context, user *url.Userinfo) error { - req := internal.URL(c, internal.SessionPath).Request(http.MethodPost) + req := c.Resource(internal.SessionPath).Request(http.MethodPost) + + req.Header.Set(internal.UseHeaderAuthn, "true") if user != nil { if password, ok := user.Password(); ok { @@ -111,15 +278,59 @@ func (c *Client) Login(ctx context.Context, user *url.Userinfo) error { } } - return c.Do(ctx, req, nil) + var id string + err := c.Do(ctx, req, &id) + if err != nil { + return err + } + + c.SessionID(id) + + return nil } func (c *Client) LoginByToken(ctx context.Context) error { return c.Login(ctx, nil) } +// Session returns the user's current session. +// Nil is returned if the session is not authenticated. +func (c *Client) Session(ctx context.Context) (*Session, error) { + var s Session + req := c.Resource(internal.SessionPath).WithAction("get").Request(http.MethodPost) + err := c.Do(ctx, req, &s) + if err != nil { + if e, ok := err.(*statusError); ok { + if e.res.StatusCode == http.StatusUnauthorized { + return nil, nil + } + } + return nil, err + } + return &s, nil +} + // Logout deletes the current session. func (c *Client) Logout(ctx context.Context) error { - req := internal.URL(c, internal.SessionPath).Request(http.MethodDelete) + req := c.Resource(internal.SessionPath).Request(http.MethodDelete) return c.Do(ctx, req, nil) } + +// Valid returns whether or not the client is valid and ready for use. +// This should be called after unmarshalling the client. +func (c *Client) Valid() bool { + if c == nil { + return false + } + + if c.Client == nil { + return false + } + + return true +} + +// Path returns rest.Path (see cache.Client) +func (c *Client) Path() string { + return Path +} diff --git a/vendor/github.com/vmware/govmomi/vapi/rest/resource.go b/vendor/github.com/vmware/govmomi/vapi/rest/resource.go new file mode 100644 index 00000000000..e6e627492ab --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/rest/resource.go @@ -0,0 +1,114 @@ +/* +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 rest + +import ( + "bytes" + "encoding/json" + "io" + "net/http" + "net/url" +) + +const ( + Path = "/rest" +) + +// Resource wraps url.URL with helpers +type Resource struct { + u *url.URL +} + +func (r *Resource) String() string { + return r.u.String() +} + +// WithID appends id to the URL.Path +func (r *Resource) WithID(id string) *Resource { + r.u.Path += "/id:" + id + return r +} + +// WithAction sets adds action to the URL.RawQuery +func (r *Resource) WithAction(action string) *Resource { + return r.WithParam("~action", action) +} + +// WithParam adds one parameter on the URL.RawQuery +func (r *Resource) WithParam(name string, value string) *Resource { + // ParseQuery handles empty case, and we control access to query string so shouldn't encounter an error case + params, err := url.ParseQuery(r.u.RawQuery) + if err != nil { + panic(err) + } + params[name] = append(params[name], value) + r.u.RawQuery = params.Encode() + return r +} + +// WithPathEncodedParam appends a parameter on the URL.RawQuery, +// For special cases where URL Path-style encoding is needed +func (r *Resource) WithPathEncodedParam(name string, value string) *Resource { + t := &url.URL{Path: value} + encodedValue := t.String() + t = &url.URL{Path: name} + encodedName := t.String() + // ParseQuery handles empty case, and we control access to query string so shouldn't encounter an error case + params, err := url.ParseQuery(r.u.RawQuery) + if err != nil { + panic(err) + } + // Values.Encode() doesn't escape exactly how we want, so we need to build the query string ourselves + if len(params) >= 1 { + r.u.RawQuery = r.u.RawQuery + "&" + encodedName + "=" + encodedValue + } else { + r.u.RawQuery = r.u.RawQuery + encodedName + "=" + encodedValue + } + return r +} + +// Request returns a new http.Request for the given method. +// An optional body can be provided for POST and PATCH methods. +func (r *Resource) Request(method string, body ...interface{}) *http.Request { + rdr := io.MultiReader() // empty body by default + if len(body) != 0 { + rdr = encode(body[0]) + } + req, err := http.NewRequest(method, r.u.String(), rdr) + if err != nil { + panic(err) + } + return req +} + +type errorReader struct { + e error +} + +func (e errorReader) Read([]byte) (int, error) { + return -1, e.e +} + +// encode body as JSON, deferring any errors until io.Reader is used. +func encode(body interface{}) io.Reader { + var b bytes.Buffer + err := json.NewEncoder(&b).Encode(body) + if err != nil { + return errorReader{err} + } + return &b +} diff --git a/vendor/github.com/vmware/govmomi/vapi/simulator/simulator.go b/vendor/github.com/vmware/govmomi/vapi/simulator/simulator.go index da376a67cb1..c43494f2b0a 100644 --- a/vendor/github.com/vmware/govmomi/vapi/simulator/simulator.go +++ b/vendor/github.com/vmware/govmomi/vapi/simulator/simulator.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2018-2022 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,52 +17,122 @@ limitations under the License. package simulator import ( + "archive/tar" + "bytes" + "context" + "crypto/tls" + "crypto/x509" + "encoding/base64" "encoding/json" + "encoding/pem" + "errors" "fmt" + "io" + "io/ioutil" "log" "net/http" "net/url" + "os" "path" + "path/filepath" "reflect" "strings" "sync" "time" "github.com/google/uuid" + + "github.com/vmware/govmomi" + "github.com/vmware/govmomi/nfc" + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/ovf" + "github.com/vmware/govmomi/simulator" + "github.com/vmware/govmomi/vapi" "github.com/vmware/govmomi/vapi/internal" + "github.com/vmware/govmomi/vapi/library" + "github.com/vmware/govmomi/vapi/rest" "github.com/vmware/govmomi/vapi/tags" + "github.com/vmware/govmomi/vapi/vcenter" + "github.com/vmware/govmomi/view" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" vim "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vim25/xml" ) -type session struct { - User string `json:"user"` - Created time.Time `json:"created_time"` - LastAccessed time.Time `json:"last_accessed_time"` +type item struct { + *library.Item + File []library.File + Template *types.ManagedObjectReference +} + +type content struct { + *library.Library + Item map[string]*item + Subs map[string]*library.Subscriber + VMTX map[string]*types.ManagedObjectReference +} + +type update struct { + *library.Session + Library *library.Library + File map[string]*library.UpdateFile +} + +type download struct { + *library.Session + Library *library.Library + File map[string]*library.DownloadFile } type handler struct { - *http.ServeMux sync.Mutex + ServeMux *http.ServeMux + URL url.URL Category map[string]*tags.Category Tag map[string]*tags.Tag Association map[string]map[internal.AssociatedObject]bool - Session map[string]*session + Session map[string]*rest.Session + Library map[string]*content + Update map[string]update + Download map[string]download + Policies []library.ContentSecurityPoliciesInfo + Trust map[string]library.TrustedCertificate +} + +func init() { + simulator.RegisterEndpoint(func(s *simulator.Service, r *simulator.Registry) { + if r.IsVPX() { + patterns, h := New(s.Listen, r.OptionManager().Setting) + for _, p := range patterns { + s.Handle(p, h) + } + } + }) } // New creates a vAPI simulator. -func New(u *url.URL, settings []vim.BaseOptionValue) (string, http.Handler) { +func New(u *url.URL, settings []vim.BaseOptionValue) ([]string, http.Handler) { s := &handler{ ServeMux: http.NewServeMux(), + URL: *u, Category: make(map[string]*tags.Category), Tag: make(map[string]*tags.Tag), Association: make(map[string]map[internal.AssociatedObject]bool), - Session: make(map[string]*session), + Session: make(map[string]*rest.Session), + Library: make(map[string]*content), + Update: make(map[string]update), + Download: make(map[string]download), + Policies: defaultSecurityPolicies(), + Trust: make(map[string]library.TrustedCertificate), } handlers := []struct { p string m http.HandlerFunc }{ + // /rest/ patterns. {internal.SessionPath, s.session}, {internal.CategoryPath, s.category}, {internal.CategoryPath + "/", s.categoryID}, @@ -70,28 +140,82 @@ func New(u *url.URL, settings []vim.BaseOptionValue) (string, http.Handler) { {internal.TagPath + "/", s.tagID}, {internal.AssociationPath, s.association}, {internal.AssociationPath + "/", s.associationID}, + {internal.LibraryPath, s.library}, + {internal.LocalLibraryPath, s.library}, + {internal.SubscribedLibraryPath, s.library}, + {internal.LibraryPath + "/", s.libraryID}, + {internal.LocalLibraryPath + "/", s.libraryID}, + {internal.SubscribedLibraryPath + "/", s.libraryID}, + {internal.Subscriptions, s.subscriptions}, + {internal.Subscriptions + "/", s.subscriptionsID}, + {internal.LibraryItemPath, s.libraryItem}, + {internal.LibraryItemPath + "/", s.libraryItemID}, + {internal.SubscribedLibraryItem + "/", s.libraryItemID}, + {internal.LibraryItemUpdateSession, s.libraryItemUpdateSession}, + {internal.LibraryItemUpdateSession + "/", s.libraryItemUpdateSessionID}, + {internal.LibraryItemUpdateSessionFile, s.libraryItemUpdateSessionFile}, + {internal.LibraryItemUpdateSessionFile + "/", s.libraryItemUpdateSessionFileID}, + {internal.LibraryItemDownloadSession, s.libraryItemDownloadSession}, + {internal.LibraryItemDownloadSession + "/", s.libraryItemDownloadSessionID}, + {internal.LibraryItemDownloadSessionFile, s.libraryItemDownloadSessionFile}, + {internal.LibraryItemDownloadSessionFile + "/", s.libraryItemDownloadSessionFileID}, + {internal.LibraryItemFileData + "/", s.libraryItemFileData}, + {internal.LibraryItemFilePath, s.libraryItemFile}, + {internal.LibraryItemFilePath + "/", s.libraryItemFileID}, + {internal.VCenterOVFLibraryItem, s.libraryItemOVF}, + {internal.VCenterOVFLibraryItem + "/", s.libraryItemOVFID}, + {internal.VCenterVMTXLibraryItem, s.libraryItemCreateTemplate}, + {internal.VCenterVMTXLibraryItem + "/", s.libraryItemTemplateID}, + {internal.VCenterVM + "/", s.vmID}, + {internal.DebugEcho, s.debugEcho}, + // /api/ patterns. + {internal.SecurityPoliciesPath, s.librarySecurityPolicies}, + {internal.TrustedCertificatesPath, s.libraryTrustedCertificates}, + {internal.TrustedCertificatesPath + "/", s.libraryTrustedCertificatesID}, } for i := range handlers { h := handlers[i] - s.HandleFunc(internal.Path+h.p, func(w http.ResponseWriter, r *http.Request) { - s.Lock() - defer s.Unlock() - - if !s.isAuthorized(r) { - w.WriteHeader(http.StatusUnauthorized) - return - } - - h.m(w, r) - }) + s.HandleFunc(h.p, h.m) } - return internal.Path + "/", s + return []string{rest.Path + "/", vapi.Path + "/"}, s +} + +func (s *handler) withClient(f func(context.Context, *vim25.Client) error) error { + ctx := context.Background() + c, err := govmomi.NewClient(ctx, &s.URL, true) + if err != nil { + return err + } + defer func() { + _ = c.Logout(ctx) + }() + return f(ctx, c.Client) +} + +// HandleFunc wraps the given handler with authorization checks and passes to http.ServeMux.HandleFunc +func (s *handler) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) { + // Rest paths have been moved from /rest/* to /api/*. Account for both the legacy and new cases here. + if !strings.HasPrefix(pattern, rest.Path) && !strings.HasPrefix(pattern, vapi.Path) { + pattern = rest.Path + pattern + } + + s.ServeMux.HandleFunc(pattern, func(w http.ResponseWriter, r *http.Request) { + s.Lock() + defer s.Unlock() + + if !s.isAuthorized(r) { + w.WriteHeader(http.StatusUnauthorized) + return + } + + handler(w, r) + }) } func (s *handler) isAuthorized(r *http.Request) bool { - if r.Method == http.MethodPost && strings.HasSuffix(r.URL.Path, internal.SessionPath) { + if r.Method == http.MethodPost && strings.HasSuffix(r.URL.Path, internal.SessionPath) && s.action(r) == "" { return true } id := r.Header.Get(internal.SessionCookieName) @@ -104,6 +228,8 @@ func (s *handler) isAuthorized(r *http.Request) bool { info, ok := s.Session[id] if ok { info.LastAccessed = time.Now() + } else { + _, ok = s.Update[id] } return ok } @@ -183,26 +309,41 @@ func (s *handler) DetachTag(id vim.ManagedObjectReference, tag vim.VslmTagEntry) return nil } -// ok responds with http.StatusOK and json encodes val if given. -func (s *handler) ok(w http.ResponseWriter, val ...interface{}) { +// StatusOK responds with http.StatusOK and encodes val, if specified, to JSON +// For use with "/api" endpoints. +func StatusOK(w http.ResponseWriter, val ...interface{}) { w.WriteHeader(http.StatusOK) - if len(val) == 0 { return } - err := json.NewEncoder(w).Encode(struct { - Value interface{} `json:"value,omitempty"` - }{ - val[0], - }) + err := json.NewEncoder(w).Encode(val[0]) if err != nil { log.Panic(err) } } -func (s *handler) fail(w http.ResponseWriter, kind string) { +// OK responds with http.StatusOK and encodes val, if specified, to JSON +// For use with "/rest" endpoints where the response is a "value" wrapped structure. +func OK(w http.ResponseWriter, val ...interface{}) { + if len(val) == 0 { + w.WriteHeader(http.StatusOK) + return + } + + s := struct { + Value interface{} `json:"value,omitempty"` + }{ + val[0], + } + + StatusOK(w, s) +} + +// BadRequest responds with http.StatusBadRequest and json encoded vAPI error of type kind. +// For use with "/rest" endpoints where the response is a "value" wrapped structure. +func BadRequest(w http.ResponseWriter, kind string) { w.WriteHeader(http.StatusBadRequest) err := json.NewEncoder(w).Encode(struct { @@ -219,20 +360,31 @@ func (s *handler) fail(w http.ResponseWriter, kind string) { } } +func (*handler) error(w http.ResponseWriter, err error) { + http.Error(w, err.Error(), http.StatusInternalServerError) + log.Print(err) +} + // ServeHTTP handles vAPI requests. func (s *handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { switch r.Method { - case http.MethodPost, http.MethodDelete, http.MethodGet, http.MethodPatch: + case http.MethodPost, http.MethodDelete, http.MethodGet, http.MethodPatch, http.MethodPut: default: w.WriteHeader(http.StatusMethodNotAllowed) return } - h, _ := s.Handler(r) + h, _ := s.ServeMux.Handler(r) h.ServeHTTP(w, r) } func (s *handler) decode(r *http.Request, w http.ResponseWriter, val interface{}) bool { + return Decode(r, w, val) +} + +// Decode the request Body into val. +// Returns true on success, otherwise false and sends the http.StatusBadRequest response. +func Decode(r *http.Request, w http.ResponseWriter, val interface{}) bool { defer r.Body.Close() err := json.NewDecoder(r.Body).Decode(val) if err != nil { @@ -243,11 +395,34 @@ func (s *handler) decode(r *http.Request, w http.ResponseWriter, val interface{} return true } +func (s *handler) expiredSession(id string, now time.Time) bool { + expired := true + s.Lock() + session, ok := s.Session[id] + if ok { + expired = now.Sub(session.LastAccessed) > simulator.SessionIdleTimeout + if expired { + delete(s.Session, id) + } + } + s.Unlock() + return expired +} + func (s *handler) session(w http.ResponseWriter, r *http.Request) { id := r.Header.Get(internal.SessionCookieName) + useHeaderAuthn := strings.ToLower(r.Header.Get(internal.UseHeaderAuthn)) switch r.Method { case http.MethodPost: + if s.action(r) != "" { + if session, ok := s.Session[id]; ok { + OK(w, session) + } else { + w.WriteHeader(http.StatusUnauthorized) + } + return + } user, ok := s.hasAuthorization(r) if !ok { w.WriteHeader(http.StatusUnauthorized) @@ -255,17 +430,21 @@ func (s *handler) session(w http.ResponseWriter, r *http.Request) { } id = uuid.New().String() now := time.Now() - s.Session[id] = &session{user, now, now} - http.SetCookie(w, &http.Cookie{ - Name: internal.SessionCookieName, - Value: id, - }) - s.ok(w, id) + s.Session[id] = &rest.Session{User: user, Created: now, LastAccessed: now} + simulator.SessionIdleWatch(context.Background(), id, s.expiredSession) + if useHeaderAuthn != "true" { + http.SetCookie(w, &http.Cookie{ + Name: internal.SessionCookieName, + Value: id, + Path: rest.Path, + }) + } + OK(w, id) case http.MethodDelete: delete(s.Session, id) - s.ok(w) + OK(w) case http.MethodGet: - s.ok(w, s.Session[id]) + OK(w, s.Session[id]) } } @@ -295,14 +474,14 @@ func (s *handler) category(w http.ResponseWriter, r *http.Request) { if s.decode(r, w, &spec) { for _, category := range s.Category { if category.Name == spec.Category.Name { - s.fail(w, "com.vmware.vapi.std.errors.already_exists") + BadRequest(w, "com.vmware.vapi.std.errors.already_exists") return } } id := newID("Category") spec.Category.ID = id s.Category[id] = &spec.Category - s.ok(w, id) + OK(w, id) } case http.MethodGet: var ids []string @@ -310,7 +489,7 @@ func (s *handler) category(w http.ResponseWriter, r *http.Request) { ids = append(ids, id) } - s.ok(w, ids) + OK(w, ids) } } @@ -332,7 +511,7 @@ func (s *handler) categoryID(w http.ResponseWriter, r *http.Request) { delete(s.Association, ix) } } - s.ok(w) + OK(w) case http.MethodPatch: var spec struct { Category tags.Category `json:"update_spec"` @@ -347,15 +526,15 @@ func (s *handler) categoryID(w http.ResponseWriter, r *http.Request) { fail = !reflect.DeepEqual(o.AssociableTypes, spec.Category.AssociableTypes[:etypes]) } if fail { - s.fail(w, "com.vmware.vapi.std.errors.invalid_argument") + BadRequest(w, "com.vmware.vapi.std.errors.invalid_argument") return } } o.Patch(&spec.Category) - s.ok(w) + OK(w) } case http.MethodGet: - s.ok(w, o) + OK(w, o) } } @@ -367,8 +546,8 @@ func (s *handler) tag(w http.ResponseWriter, r *http.Request) { } if s.decode(r, w, &spec) { for _, tag := range s.Tag { - if tag.Name == spec.Tag.Name { - s.fail(w, "com.vmware.vapi.std.errors.already_exists") + if tag.Name == spec.Tag.Name && tag.CategoryID == spec.Tag.CategoryID { + BadRequest(w, "com.vmware.vapi.std.errors.already_exists") return } } @@ -376,14 +555,14 @@ func (s *handler) tag(w http.ResponseWriter, r *http.Request) { spec.Tag.ID = id s.Tag[id] = &spec.Tag s.Association[id] = make(map[internal.AssociatedObject]bool) - s.ok(w, id) + OK(w, id) } case http.MethodGet: var ids []string for id := range s.Tag { ids = append(ids, id) } - s.ok(w, ids) + OK(w, ids) } } @@ -398,7 +577,7 @@ func (s *handler) tagID(w http.ResponseWriter, r *http.Request) { ids = append(ids, tag.ID) } } - s.ok(w, ids) + OK(w, ids) return } @@ -413,27 +592,32 @@ func (s *handler) tagID(w http.ResponseWriter, r *http.Request) { case http.MethodDelete: delete(s.Tag, id) delete(s.Association, id) - s.ok(w) + OK(w) case http.MethodPatch: var spec struct { Tag tags.Tag `json:"update_spec"` } if s.decode(r, w, &spec) { o.Patch(&spec.Tag) - s.ok(w) + OK(w) } case http.MethodGet: - s.ok(w, o) + OK(w, o) } } +// TODO: support cardinality checks func (s *handler) association(w http.ResponseWriter, r *http.Request) { if r.Method != http.MethodPost { w.WriteHeader(http.StatusMethodNotAllowed) return } - var spec internal.Association + var spec struct { + internal.Association + TagIDs []string `json:"tag_ids,omitempty"` + ObjectIDs []internal.AssociatedObject `json:"object_ids,omitempty"` + } if !s.decode(r, w, &spec) { return } @@ -446,7 +630,81 @@ func (s *handler) association(w http.ResponseWriter, r *http.Request) { ids = append(ids, id) } } - s.ok(w, ids) + OK(w, ids) + + case "list-attached-objects-on-tags": + var res []tags.AttachedObjects + for _, id := range spec.TagIDs { + o := tags.AttachedObjects{TagID: id} + for i := range s.Association[id] { + o.ObjectIDs = append(o.ObjectIDs, i) + } + res = append(res, o) + } + OK(w, res) + + case "list-attached-tags-on-objects": + var res []tags.AttachedTags + for _, ref := range spec.ObjectIDs { + o := tags.AttachedTags{ObjectID: ref} + for id, objs := range s.Association { + if objs[ref] { + o.TagIDs = append(o.TagIDs, id) + } + } + res = append(res, o) + } + OK(w, res) + + case "attach-multiple-tags-to-object": + // TODO: add check if target (moref) exist or return 403 as per API behavior + + res := struct { + Success bool `json:"success"` + Errors tags.BatchErrors `json:"error_messages,omitempty"` + }{} + + for _, id := range spec.TagIDs { + if _, exists := s.Association[id]; !exists { + log.Printf("association tag not found: %s", id) + res.Errors = append(res.Errors, tags.BatchError{ + Type: "cis.tagging.objectNotFound.error", + Message: fmt.Sprintf("Tagging object %s not found", id), + }) + } else { + s.Association[id][*spec.ObjectID] = true + } + } + + if len(res.Errors) == 0 { + res.Success = true + } + OK(w, res) + + case "detach-multiple-tags-from-object": + // TODO: add check if target (moref) exist or return 403 as per API behavior + + res := struct { + Success bool `json:"success"` + Errors tags.BatchErrors `json:"error_messages,omitempty"` + }{} + + for _, id := range spec.TagIDs { + if _, exists := s.Association[id]; !exists { + log.Printf("association tag not found: %s", id) + res.Errors = append(res.Errors, tags.BatchError{ + Type: "cis.tagging.objectNotFound.error", + Message: fmt.Sprintf("Tagging object %s not found", id), + }) + } else { + s.Association[id][*spec.ObjectID] = false + } + } + + if len(res.Errors) == 0 { + res.Success = true + } + OK(w, res) } } @@ -464,22 +722,1560 @@ func (s *handler) associationID(w http.ResponseWriter, r *http.Request) { } var spec internal.Association - if !s.decode(r, w, &spec) { - return + var specs struct { + ObjectIDs []internal.AssociatedObject `json:"object_ids"` + } + switch s.action(r) { + case "attach", "detach", "list-attached-objects": + if !s.decode(r, w, &spec) { + return + } + case "attach-tag-to-multiple-objects": + if !s.decode(r, w, &specs) { + return + } } switch s.action(r) { case "attach": s.Association[id][*spec.ObjectID] = true - s.ok(w) + OK(w) case "detach": delete(s.Association[id], *spec.ObjectID) - s.ok(w) + OK(w) case "list-attached-objects": var ids []internal.AssociatedObject for id := range s.Association[id] { ids = append(ids, id) } - s.ok(w, ids) + OK(w, ids) + case "attach-tag-to-multiple-objects": + for _, obj := range specs.ObjectIDs { + s.Association[id][obj] = true + } + OK(w) } } + +func (s *handler) library(w http.ResponseWriter, r *http.Request) { + switch r.Method { + case http.MethodPost: + var spec struct { + Library library.Library `json:"create_spec"` + Find library.Find `json:"spec"` + } + if !s.decode(r, w, &spec) { + return + } + + switch s.action(r) { + case "find": + var ids []string + for _, l := range s.Library { + if spec.Find.Type != "" { + if spec.Find.Type != l.Library.Type { + continue + } + } + if spec.Find.Name != "" { + if !strings.EqualFold(l.Library.Name, spec.Find.Name) { + continue + } + } + ids = append(ids, l.ID) + } + OK(w, ids) + case "": + if !s.isValidSecurityPolicy(spec.Library.SecurityPolicyID) { + http.NotFound(w, r) + return + } + + id := uuid.New().String() + spec.Library.ID = id + spec.Library.CreationTime = types.NewTime(time.Now()) + spec.Library.LastModifiedTime = types.NewTime(time.Now()) + spec.Library.UnsetSecurityPolicyID = spec.Library.SecurityPolicyID == "" + dir := libraryPath(&spec.Library, "") + if err := os.Mkdir(dir, 0750); err != nil { + s.error(w, err) + return + } + s.Library[id] = &content{ + Library: &spec.Library, + Item: make(map[string]*item), + Subs: make(map[string]*library.Subscriber), + VMTX: make(map[string]*types.ManagedObjectReference), + } + + pub := spec.Library.Publication + if pub != nil && pub.Published != nil && *pub.Published { + // Generate PublishURL as real vCenter does + pub.PublishURL = (&url.URL{ + Scheme: s.URL.Scheme, + Host: s.URL.Host, + Path: "/cls/vcsp/lib/" + id, + }).String() + } + + sub := spec.Library.Subscription + if sub != nil { + // Share the published Item map + pid := path.Base(sub.SubscriptionURL) + if p, ok := s.Library[pid]; ok { + s.Library[id].Item = p.Item + } + } + + OK(w, id) + } + case http.MethodGet: + var ids []string + for id := range s.Library { + ids = append(ids, id) + } + OK(w, ids) + } +} + +func (s *handler) publish(w http.ResponseWriter, r *http.Request, sids []internal.SubscriptionDestination, l *content, vmtx *item) bool { + var ids []string + if len(sids) == 0 { + for sid := range l.Subs { + ids = append(ids, sid) + } + } else { + for _, dst := range sids { + ids = append(ids, dst.ID) + } + } + + for _, sid := range ids { + sub, ok := l.Subs[sid] + if !ok { + log.Printf("library subscription not found: %s", sid) + http.NotFound(w, r) + return false + } + + slib := s.Library[sub.LibraryID] + if slib.VMTX[vmtx.ID] != nil { + return true // already cloned + } + + ds := &vcenter.DiskStorage{Datastore: l.Library.Storage[0].DatastoreID} + ref, err := s.cloneVM(vmtx.Template.Value, vmtx.Name, sub.Placement, ds) + if err != nil { + s.error(w, err) + return false + } + + slib.VMTX[vmtx.ID] = ref + } + + return true +} + +func (s *handler) libraryID(w http.ResponseWriter, r *http.Request) { + id := s.id(r) + l, ok := s.Library[id] + if !ok { + log.Printf("library not found: %s", id) + http.NotFound(w, r) + return + } + + switch r.Method { + case http.MethodDelete: + p := libraryPath(l.Library, "") + if err := os.RemoveAll(p); err != nil { + s.error(w, err) + return + } + for _, item := range l.Item { + s.deleteVM(item.Template) + } + delete(s.Library, id) + OK(w) + case http.MethodPatch: + var spec struct { + Library library.Library `json:"update_spec"` + } + if s.decode(r, w, &spec) { + l.Patch(&spec.Library) + OK(w) + } + case http.MethodPost: + switch s.action(r) { + case "publish": + var spec internal.SubscriptionDestinationSpec + if !s.decode(r, w, &spec) { + return + } + for _, item := range l.Item { + if item.Type != library.ItemTypeVMTX { + continue + } + if !s.publish(w, r, spec.Subscriptions, l, item) { + return + } + } + OK(w) + case "sync": + if l.Type == "SUBSCRIBED" { + l.LastSyncTime = types.NewTime(time.Now()) + OK(w) + } else { + http.NotFound(w, r) + } + } + case http.MethodGet: + OK(w, l) + } +} + +func (s *handler) subscriptions(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodGet { + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + + id := r.URL.Query().Get("library") + l, ok := s.Library[id] + if !ok { + log.Printf("library not found: %s", id) + http.NotFound(w, r) + return + } + + var res []library.SubscriberSummary + for sid, slib := range l.Subs { + res = append(res, library.SubscriberSummary{ + LibraryID: slib.LibraryID, + LibraryName: slib.LibraryName, + SubscriptionID: sid, + LibraryVcenterHostname: "", + }) + } + OK(w, res) +} + +func (s *handler) subscriptionsID(w http.ResponseWriter, r *http.Request) { + id := s.id(r) + l, ok := s.Library[id] + if !ok { + log.Printf("library not found: %s", id) + http.NotFound(w, r) + return + } + + switch s.action(r) { + case "get": + var dst internal.SubscriptionDestination + if !s.decode(r, w, &dst) { + return + } + + sub, ok := l.Subs[dst.ID] + if !ok { + log.Printf("library subscription not found: %s", dst.ID) + http.NotFound(w, r) + return + } + + OK(w, sub) + case "delete": + var dst internal.SubscriptionDestination + if !s.decode(r, w, &dst) { + return + } + + delete(l.Subs, dst.ID) + + OK(w) + case "create", "": + var spec struct { + Sub struct { + SubscriberLibrary library.SubscriberLibrary `json:"subscribed_library"` + } `json:"spec"` + } + if !s.decode(r, w, &spec) { + return + } + + sub := spec.Sub.SubscriberLibrary + slib, ok := s.Library[sub.LibraryID] + if !ok { + log.Printf("library not found: %s", sub.LibraryID) + http.NotFound(w, r) + return + } + + id := uuid.New().String() + l.Subs[id] = &library.Subscriber{ + LibraryID: slib.ID, + LibraryName: slib.Name, + LibraryLocation: sub.Target, + Placement: sub.Placement, + Vcenter: sub.Vcenter, + } + + OK(w, id) + } +} + +func (s *handler) libraryItem(w http.ResponseWriter, r *http.Request) { + switch r.Method { + case http.MethodPost: + var spec struct { + Item library.Item `json:"create_spec"` + Find library.FindItem `json:"spec"` + } + if !s.decode(r, w, &spec) { + return + } + + switch s.action(r) { + case "find": + var ids []string + for _, l := range s.Library { + if spec.Find.LibraryID != "" { + if spec.Find.LibraryID != l.ID { + continue + } + } + for _, i := range l.Item { + if spec.Find.Name != "" { + if spec.Find.Name != i.Name { + continue + } + } + if spec.Find.Type != "" { + if spec.Find.Type != i.Type { + continue + } + } + ids = append(ids, i.ID) + } + } + OK(w, ids) + case "create", "": + id := spec.Item.LibraryID + l, ok := s.Library[id] + if !ok { + log.Printf("library not found: %s", id) + http.NotFound(w, r) + return + } + if l.Type == "SUBSCRIBED" { + BadRequest(w, "com.vmware.vapi.std.errors.invalid_element_type") + return + } + for _, item := range l.Item { + if item.Name == spec.Item.Name { + BadRequest(w, "com.vmware.vapi.std.errors.already_exists") + return + } + } + id = uuid.New().String() + spec.Item.ID = id + spec.Item.CreationTime = types.NewTime(time.Now()) + spec.Item.LastModifiedTime = types.NewTime(time.Now()) + if l.SecurityPolicyID != "" { + // TODO: verify signed items + spec.Item.SecurityCompliance = types.NewBool(false) + spec.Item.CertificateVerification = &library.ItemCertificateVerification{ + Status: "NOT_AVAILABLE", + } + } + l.Item[id] = &item{Item: &spec.Item} + OK(w, id) + } + case http.MethodGet: + id := r.URL.Query().Get("library_id") + l, ok := s.Library[id] + if !ok { + log.Printf("library not found: %s", id) + http.NotFound(w, r) + return + } + + var ids []string + for id := range l.Item { + ids = append(ids, id) + } + OK(w, ids) + } +} + +func (s *handler) libraryItemID(w http.ResponseWriter, r *http.Request) { + id := s.id(r) + lid := r.URL.Query().Get("library_id") + if lid == "" { + if l := s.itemLibrary(id); l != nil { + lid = l.ID + } + } + l, ok := s.Library[lid] + if !ok { + log.Printf("library not found: %q", lid) + http.NotFound(w, r) + return + } + item, ok := l.Item[id] + if !ok { + log.Printf("library item not found: %q", id) + http.NotFound(w, r) + return + } + + switch r.Method { + case http.MethodDelete: + p := libraryPath(l.Library, id) + if err := os.RemoveAll(p); err != nil { + s.error(w, err) + return + } + s.deleteVM(l.Item[item.ID].Template) + delete(l.Item, item.ID) + OK(w) + case http.MethodPatch: + var spec struct { + library.Item `json:"update_spec"` + } + if s.decode(r, w, &spec) { + item.Patch(&spec.Item) + OK(w) + } + case http.MethodPost: + switch s.action(r) { + case "copy": + var spec struct { + library.Item `json:"destination_create_spec"` + } + if !s.decode(r, w, &spec) { + return + } + + l, ok = s.Library[spec.LibraryID] + if !ok { + log.Printf("library not found: %q", spec.LibraryID) + http.NotFound(w, r) + return + } + if spec.Name == "" { + BadRequest(w, "com.vmware.vapi.std.errors.invalid_argument") + } + + id := uuid.New().String() + nitem := item.cp() + nitem.ID = id + nitem.LibraryID = spec.LibraryID + l.Item[id] = nitem + + OK(w, id) + case "sync": + if l.Type == "SUBSCRIBED" { + item.LastSyncTime = types.NewTime(time.Now()) + OK(w) + } else { + http.NotFound(w, r) + } + case "publish": + var spec internal.SubscriptionDestinationSpec + if s.decode(r, w, &spec) { + if s.publish(w, r, spec.Subscriptions, l, item) { + OK(w) + } + } + } + case http.MethodGet: + OK(w, item) + } +} + +func (s *handler) libraryItemUpdateSession(w http.ResponseWriter, r *http.Request) { + switch r.Method { + case http.MethodGet: + var ids []string + for id := range s.Update { + ids = append(ids, id) + } + OK(w, ids) + case http.MethodPost: + var spec struct { + Session library.Session `json:"create_spec"` + } + if !s.decode(r, w, &spec) { + return + } + + switch s.action(r) { + case "create", "": + lib := s.itemLibrary(spec.Session.LibraryItemID) + if lib == nil { + log.Printf("library for item %q not found", spec.Session.LibraryItemID) + http.NotFound(w, r) + return + } + session := &library.Session{ + ID: uuid.New().String(), + LibraryItemID: spec.Session.LibraryItemID, + LibraryItemContentVersion: "1", + ClientProgress: 0, + State: "ACTIVE", + ExpirationTime: types.NewTime(time.Now().Add(time.Hour)), + } + s.Update[session.ID] = update{ + Session: session, + Library: lib, + File: make(map[string]*library.UpdateFile), + } + OK(w, session.ID) + } + } +} + +func (s *handler) libraryItemUpdateSessionID(w http.ResponseWriter, r *http.Request) { + id := s.id(r) + up, ok := s.Update[id] + if !ok { + log.Printf("update session not found: %s", id) + http.NotFound(w, r) + return + } + + session := up.Session + done := func(state string) { + up.State = state + go time.AfterFunc(session.ExpirationTime.Sub(time.Now()), func() { + s.Lock() + delete(s.Update, id) + s.Unlock() + }) + } + + switch r.Method { + case http.MethodGet: + OK(w, session) + case http.MethodPost: + switch s.action(r) { + case "cancel": + done("CANCELED") + case "complete": + done("DONE") + case "fail": + done("ERROR") + case "keep-alive": + session.ExpirationTime = types.NewTime(time.Now().Add(time.Hour)) + } + OK(w) + case http.MethodDelete: + delete(s.Update, id) + OK(w) + } +} + +func (s *handler) libraryItemUpdateSessionFile(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodGet { + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + + id := r.URL.Query().Get("update_session_id") + up, ok := s.Update[id] + if !ok { + log.Printf("update session not found: %s", id) + http.NotFound(w, r) + return + } + + var files []*library.UpdateFile + for _, f := range up.File { + files = append(files, f) + } + OK(w, files) +} + +func (s *handler) pullSource(up update, info *library.UpdateFile) { + done := func(err error) { + s.Lock() + info.Status = "READY" + if err != nil { + log.Printf("PULL %s: %s", info.SourceEndpoint.URI, err) + info.Status = "ERROR" + up.State = "ERROR" + up.ErrorMessage = &rest.LocalizableMessage{DefaultMessage: err.Error()} + } + s.Unlock() + } + + c := &http.Client{ + Transport: &http.Transport{ + TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, + }, + } + + res, err := c.Get(info.SourceEndpoint.URI) + if err != nil { + done(err) + return + } + + err = s.libraryItemFileCreate(&up, info.Name, res.Body) + done(err) +} + +func (s *handler) libraryItemUpdateSessionFileID(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodPost { + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + + id := s.id(r) + up, ok := s.Update[id] + if !ok { + log.Printf("update session not found: %s", id) + http.NotFound(w, r) + return + } + + switch s.action(r) { + case "add": + var spec struct { + File library.UpdateFile `json:"file_spec"` + } + if s.decode(r, w, &spec) { + id = uuid.New().String() + info := &library.UpdateFile{ + Name: spec.File.Name, + SourceType: spec.File.SourceType, + Status: "WAITING_FOR_TRANSFER", + BytesTransferred: 0, + } + switch info.SourceType { + case "PUSH": + u := url.URL{ + Scheme: s.URL.Scheme, + Host: s.URL.Host, + Path: path.Join(rest.Path, internal.LibraryItemFileData, id, info.Name), + } + info.UploadEndpoint = &library.TransferEndpoint{URI: u.String()} + case "PULL": + info.SourceEndpoint = spec.File.SourceEndpoint + go s.pullSource(up, info) + } + up.File[id] = info + OK(w, info) + } + case "get": + OK(w, up.Session) + case "list": + var ids []string + for id := range up.File { + ids = append(ids, id) + } + OK(w, ids) + case "remove": + delete(s.Update, id) + OK(w) + case "validate": + // TODO + } +} + +func (s *handler) libraryItemDownloadSession(w http.ResponseWriter, r *http.Request) { + switch r.Method { + case http.MethodGet: + var ids []string + for id := range s.Download { + ids = append(ids, id) + } + OK(w, ids) + case http.MethodPost: + var spec struct { + Session library.Session `json:"create_spec"` + } + if !s.decode(r, w, &spec) { + return + } + + switch s.action(r) { + case "create", "": + var lib *library.Library + var files []library.File + for _, l := range s.Library { + if item, ok := l.Item[spec.Session.LibraryItemID]; ok { + lib = l.Library + files = item.File + break + } + } + if lib == nil { + log.Printf("library for item %q not found", spec.Session.LibraryItemID) + http.NotFound(w, r) + return + } + session := &library.Session{ + ID: uuid.New().String(), + LibraryItemID: spec.Session.LibraryItemID, + LibraryItemContentVersion: "1", + ClientProgress: 0, + State: "ACTIVE", + ExpirationTime: types.NewTime(time.Now().Add(time.Hour)), + } + s.Download[session.ID] = download{ + Session: session, + Library: lib, + File: make(map[string]*library.DownloadFile), + } + for _, file := range files { + s.Download[session.ID].File[file.Name] = &library.DownloadFile{ + Name: file.Name, + Status: "UNPREPARED", + } + } + OK(w, session.ID) + } + } +} + +func (s *handler) libraryItemDownloadSessionID(w http.ResponseWriter, r *http.Request) { + id := s.id(r) + up, ok := s.Download[id] + if !ok { + log.Printf("download session not found: %s", id) + http.NotFound(w, r) + return + } + + session := up.Session + switch r.Method { + case http.MethodGet: + OK(w, session) + case http.MethodPost: + switch s.action(r) { + case "cancel", "complete", "fail": + delete(s.Download, id) // TODO: fully mock VC's behavior + case "keep-alive": + session.ExpirationTime = types.NewTime(time.Now().Add(time.Hour)) + } + OK(w) + case http.MethodDelete: + delete(s.Download, id) + OK(w) + } +} + +func (s *handler) libraryItemDownloadSessionFile(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodGet { + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + + id := r.URL.Query().Get("download_session_id") + dl, ok := s.Download[id] + if !ok { + log.Printf("download session not found: %s", id) + http.NotFound(w, r) + return + } + + var files []*library.DownloadFile + for _, f := range dl.File { + files = append(files, f) + } + OK(w, files) +} + +func (s *handler) libraryItemDownloadSessionFileID(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodPost { + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + + id := s.id(r) + dl, ok := s.Download[id] + if !ok { + log.Printf("download session not found: %s", id) + http.NotFound(w, r) + return + } + + var spec struct { + File string `json:"file_name"` + } + + switch s.action(r) { + case "prepare": + if s.decode(r, w, &spec) { + u := url.URL{ + Scheme: s.URL.Scheme, + Host: s.URL.Host, + Path: path.Join(rest.Path, internal.LibraryItemFileData, id, spec.File), + } + info := &library.DownloadFile{ + Name: spec.File, + Status: "PREPARED", + BytesTransferred: 0, + DownloadEndpoint: &library.TransferEndpoint{ + URI: u.String(), + }, + } + dl.File[spec.File] = info + OK(w, info) + } + case "get": + if s.decode(r, w, &spec) { + OK(w, dl.File[spec.File]) + } + } +} + +func (s *handler) itemLibrary(id string) *library.Library { + for _, l := range s.Library { + if _, ok := l.Item[id]; ok { + return l.Library + } + } + return nil +} + +func (s *handler) updateFileInfo(id string) *update { + for _, up := range s.Update { + for i := range up.File { + if i == id { + return &up + } + } + } + return nil +} + +// libraryPath returns the local Datastore fs path for a Library or Item if id is specified. +func libraryPath(l *library.Library, id string) string { + dsref := types.ManagedObjectReference{ + Type: "Datastore", + Value: l.Storage[0].DatastoreID, + } + ds := simulator.Map.Get(dsref).(*simulator.Datastore) + + return path.Join(append([]string{ds.Info.GetDatastoreInfo().Url, "contentlib-" + l.ID}, id)...) +} + +func (s *handler) libraryItemFileCreate(up *update, name string, body io.ReadCloser) error { + var in io.Reader = body + dir := libraryPath(up.Library, up.Session.LibraryItemID) + if err := os.MkdirAll(dir, 0750); err != nil { + return err + } + + if path.Ext(name) == ".ova" { + // All we need is the .ovf, vcsim has no use for .vmdk or .mf + r := tar.NewReader(body) + for { + h, err := r.Next() + if err != nil { + return err + } + + if path.Ext(h.Name) == ".ovf" { + name = h.Name + in = io.LimitReader(body, h.Size) + break + } + } + } + + file, err := os.Create(path.Join(dir, name)) + if err != nil { + return err + } + + n, err := io.Copy(file, in) + _ = body.Close() + if err != nil { + return err + } + err = file.Close() + if err != nil { + return err + } + + i := s.Library[up.Library.ID].Item[up.Session.LibraryItemID] + i.File = append(i.File, library.File{ + Cached: types.NewBool(true), + Name: name, + Size: types.NewInt64(n), + Version: "1", + }) + + return nil +} + +func (s *handler) libraryItemFileData(w http.ResponseWriter, r *http.Request) { + p := strings.Split(r.URL.Path, "/") + id, name := p[len(p)-2], p[len(p)-1] + + if r.Method == http.MethodGet { + dl, ok := s.Download[id] + if !ok { + log.Printf("library download not found: %s", id) + http.NotFound(w, r) + return + } + p := path.Join(libraryPath(dl.Library, dl.Session.LibraryItemID), name) + f, err := os.Open(p) + if err != nil { + s.error(w, err) + return + } + _, err = io.Copy(w, f) + if err != nil { + log.Printf("copy %s: %s", p, err) + } + _ = f.Close() + return + } + + if r.Method != http.MethodPut { + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + + up := s.updateFileInfo(id) + if up == nil { + log.Printf("library update not found: %s", id) + http.NotFound(w, r) + return + } + + err := s.libraryItemFileCreate(up, name, r.Body) + if err != nil { + s.error(w, err) + } +} + +func (s *handler) libraryItemFile(w http.ResponseWriter, r *http.Request) { + id := r.URL.Query().Get("library_item_id") + for _, l := range s.Library { + if i, ok := l.Item[id]; ok { + OK(w, i.File) + return + } + } + http.NotFound(w, r) +} + +func (s *handler) libraryItemFileID(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodPost { + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + id := s.id(r) + var spec struct { + Name string `json:"name"` + } + if !s.decode(r, w, &spec) { + return + } + for _, l := range s.Library { + if i, ok := l.Item[id]; ok { + for _, f := range i.File { + if f.Name == spec.Name { + OK(w, f) + return + } + } + } + } + http.NotFound(w, r) +} + +func (i *item) cp() *item { + nitem := *i.Item + return &item{&nitem, i.File, i.Template} +} + +func (i *item) ovf() string { + for _, f := range i.File { + if strings.HasSuffix(f.Name, ".ovf") { + return f.Name + } + } + return "" +} + +func vmConfigSpec(ctx context.Context, c *vim25.Client, deploy vcenter.Deploy) (*types.VirtualMachineConfigSpec, error) { + if deploy.VmConfigSpec == nil { + return nil, nil + } + + b, err := base64.StdEncoding.DecodeString(deploy.VmConfigSpec.XML) + if err != nil { + return nil, err + } + + var spec *types.VirtualMachineConfigSpec + + dec := xml.NewDecoder(bytes.NewReader(b)) + dec.TypeFunc = c.Types + err = dec.Decode(&spec) + if err != nil { + return nil, err + } + + return spec, nil +} + +func (s *handler) libraryDeploy(ctx context.Context, c *vim25.Client, lib *library.Library, item *item, deploy vcenter.Deploy) (*nfc.LeaseInfo, error) { + config, err := vmConfigSpec(ctx, c, deploy) + if err != nil { + return nil, err + } + + name := item.ovf() + desc, err := ioutil.ReadFile(filepath.Join(libraryPath(lib, item.ID), name)) + if err != nil { + return nil, err + } + ds := types.ManagedObjectReference{Type: "Datastore", Value: deploy.DeploymentSpec.DefaultDatastoreID} + pool := types.ManagedObjectReference{Type: "ResourcePool", Value: deploy.Target.ResourcePoolID} + var folder, host *types.ManagedObjectReference + if deploy.Target.FolderID != "" { + folder = &types.ManagedObjectReference{Type: "Folder", Value: deploy.Target.FolderID} + } + if deploy.Target.HostID != "" { + host = &types.ManagedObjectReference{Type: "HostSystem", Value: deploy.Target.HostID} + } + + v, err := view.NewManager(c).CreateContainerView(ctx, c.ServiceContent.RootFolder, nil, true) + if err != nil { + return nil, err + } + defer func() { + _ = v.Destroy(ctx) + }() + refs, err := v.Find(ctx, []string{"Network"}, nil) + if err != nil { + return nil, err + } + + var network []types.OvfNetworkMapping + for _, net := range deploy.NetworkMappings { + for i := range refs { + if refs[i].Value == net.Value { + network = append(network, types.OvfNetworkMapping{Name: net.Key, Network: refs[i]}) + break + } + } + } + + if ds.Value == "" { + // Datastore is optional in the deploy spec, but not in OvfManager.CreateImportSpec + refs, err = v.Find(ctx, []string{"Datastore"}, nil) + if err != nil { + return nil, err + } + // TODO: consider StorageProfileID + ds = refs[0] + } + + cisp := types.OvfCreateImportSpecParams{ + DiskProvisioning: deploy.DeploymentSpec.StorageProvisioning, + EntityName: deploy.DeploymentSpec.Name, + NetworkMapping: network, + } + + for _, p := range deploy.AdditionalParams { + switch p.Type { + case vcenter.TypePropertyParams: + for _, prop := range p.Properties { + cisp.PropertyMapping = append(cisp.PropertyMapping, types.KeyValue{ + Key: prop.ID, + Value: prop.Value, + }) + } + case vcenter.TypeDeploymentOptionParams: + cisp.OvfManagerCommonParams.DeploymentOption = p.SelectedKey + } + } + + m := ovf.NewManager(c) + spec, err := m.CreateImportSpec(ctx, string(desc), pool, ds, cisp) + if err != nil { + return nil, err + } + if spec.Error != nil { + return nil, errors.New(spec.Error[0].LocalizedMessage) + } + + req := types.ImportVApp{ + This: pool, + Spec: spec.ImportSpec, + Folder: folder, + Host: host, + } + res, err := methods.ImportVApp(ctx, c, &req) + if err != nil { + return nil, err + } + + lease := nfc.NewLease(c, res.Returnval) + info, err := lease.Wait(ctx, spec.FileItem) + if err != nil { + return nil, err + } + + if err = lease.Complete(ctx); err != nil { + return nil, err + } + + if config != nil { + if err = s.reconfigVM(info.Entity, *config); err != nil { + return nil, err + } + } + + return info, nil +} + +func (s *handler) libraryItemOVF(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodPost { + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + + var req vcenter.OVF + if !s.decode(r, w, &req) { + return + } + + switch { + case req.Target.LibraryItemID != "": + case req.Target.LibraryID != "": + l, ok := s.Library[req.Target.LibraryID] + if !ok { + http.NotFound(w, r) + } + + id := uuid.New().String() + l.Item[id] = &item{ + Item: &library.Item{ + ID: id, + LibraryID: l.Library.ID, + Name: req.Spec.Name, + Description: req.Spec.Description, + Type: library.ItemTypeOVF, + CreationTime: types.NewTime(time.Now()), + LastModifiedTime: types.NewTime(time.Now()), + }, + } + + res := vcenter.CreateResult{ + Succeeded: true, + ID: id, + } + OK(w, res) + default: + BadRequest(w, "com.vmware.vapi.std.errors.invalid_argument") + return + } +} + +func (s *handler) libraryItemOVFID(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodPost { + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + + id := s.id(r) + ok := false + var lib *library.Library + var item *item + for _, l := range s.Library { + if l.Library.Type == "SUBSCRIBED" { + // Subscribers share the same Item map, we need the LOCAL library to find the .ovf on disk + continue + } + item, ok = l.Item[id] + if ok { + lib = l.Library + break + } + } + if !ok { + log.Printf("library item not found: %q", id) + http.NotFound(w, r) + return + } + + var spec struct { + vcenter.Deploy + } + if !s.decode(r, w, &spec) { + return + } + + switch s.action(r) { + case "deploy": + var d vcenter.Deployment + err := s.withClient(func(ctx context.Context, c *vim25.Client) error { + info, err := s.libraryDeploy(ctx, c, lib, item, spec.Deploy) + if err != nil { + return err + } + id := vcenter.ResourceID(info.Entity) + d.Succeeded = true + d.ResourceID = &id + return nil + }) + if err != nil { + d.Error = &vcenter.DeploymentError{ + Errors: []vcenter.OVFError{{ + Category: "SERVER", + Error: &vcenter.Error{ + Class: "com.vmware.vapi.std.errors.error", + Messages: []rest.LocalizableMessage{ + { + DefaultMessage: err.Error(), + }, + }, + }, + }}, + } + } + OK(w, d) + case "filter": + res := vcenter.FilterResponse{ + Name: item.Name, + } + OK(w, res) + default: + http.NotFound(w, r) + } +} + +func (s *handler) deleteVM(ref *types.ManagedObjectReference) { + if ref == nil { + return + } + _ = s.withClient(func(ctx context.Context, c *vim25.Client) error { + _, _ = object.NewVirtualMachine(c, *ref).Destroy(ctx) + return nil + }) +} + +func (s *handler) reconfigVM(ref types.ManagedObjectReference, config types.VirtualMachineConfigSpec) error { + return s.withClient(func(ctx context.Context, c *vim25.Client) error { + vm := object.NewVirtualMachine(c, ref) + task, err := vm.Reconfigure(ctx, config) + if err != nil { + return err + } + return task.Wait(ctx) + }) +} + +func (s *handler) cloneVM(source string, name string, p *library.Placement, storage *vcenter.DiskStorage) (*types.ManagedObjectReference, error) { + var folder, pool, host, ds *types.ManagedObjectReference + if p.Folder != "" { + folder = &types.ManagedObjectReference{Type: "Folder", Value: p.Folder} + } + if p.ResourcePool != "" { + pool = &types.ManagedObjectReference{Type: "ResourcePool", Value: p.ResourcePool} + } + if p.Host != "" { + host = &types.ManagedObjectReference{Type: "HostSystem", Value: p.Host} + } + if storage != nil { + if storage.Datastore != "" { + ds = &types.ManagedObjectReference{Type: "Datastore", Value: storage.Datastore} + } + } + + spec := types.VirtualMachineCloneSpec{ + Template: true, + Location: types.VirtualMachineRelocateSpec{ + Folder: folder, + Pool: pool, + Host: host, + Datastore: ds, + }, + } + + var ref *types.ManagedObjectReference + + return ref, s.withClient(func(ctx context.Context, c *vim25.Client) error { + vm := object.NewVirtualMachine(c, types.ManagedObjectReference{Type: "VirtualMachine", Value: source}) + + task, err := vm.Clone(ctx, object.NewFolder(c, *folder), name, spec) + if err != nil { + return err + } + res, err := task.WaitForResult(ctx, nil) + if err != nil { + return err + } + ref = types.NewReference(res.Result.(types.ManagedObjectReference)) + return nil + }) +} + +func (s *handler) libraryItemCreateTemplate(w http.ResponseWriter, r *http.Request) { + if r.Method != http.MethodPost { + w.WriteHeader(http.StatusMethodNotAllowed) + return + } + + var spec struct { + vcenter.Template `json:"spec"` + } + if !s.decode(r, w, &spec) { + return + } + + l, ok := s.Library[spec.Library] + if !ok { + http.NotFound(w, r) + return + } + + ds := &vcenter.DiskStorage{Datastore: l.Library.Storage[0].DatastoreID} + ref, err := s.cloneVM(spec.SourceVM, spec.Name, spec.Placement, ds) + if err != nil { + BadRequest(w, err.Error()) + return + } + + id := uuid.New().String() + l.Item[id] = &item{ + Item: &library.Item{ + ID: id, + LibraryID: l.Library.ID, + Name: spec.Name, + Type: library.ItemTypeVMTX, + CreationTime: types.NewTime(time.Now()), + LastModifiedTime: types.NewTime(time.Now()), + }, + Template: ref, + } + + OK(w, id) +} + +func (s *handler) libraryItemTemplateID(w http.ResponseWriter, r *http.Request) { + // Go's ServeMux doesn't support wildcard matching, hacking around that for now to support + // CheckOuts, e.g. "/vcenter/vm-template/library-items/{item}/check-outs/{vm}?action=check-in" + p := strings.TrimPrefix(r.URL.Path, rest.Path+internal.VCenterVMTXLibraryItem+"/") + route := strings.Split(p, "/") + if len(route) == 0 { + http.NotFound(w, r) + return + } + + id := route[0] + ok := false + + var item *item + for _, l := range s.Library { + item, ok = l.Item[id] + if ok { + break + } + } + if !ok { + log.Printf("library item not found: %q", id) + http.NotFound(w, r) + return + } + + if item.Type != library.ItemTypeVMTX { + BadRequest(w, "com.vmware.vapi.std.errors.invalid_argument") + return + } + + if len(route) > 1 { + switch route[1] { + case "check-outs": + s.libraryItemCheckOuts(item, w, r) + return + default: + http.NotFound(w, r) + return + } + } + + if r.Method == http.MethodGet { + // TODO: add mock data + t := &vcenter.TemplateInfo{} + OK(w, t) + return + } + + var spec struct { + vcenter.DeployTemplate `json:"spec"` + } + if !s.decode(r, w, &spec) { + return + } + + switch r.URL.Query().Get("action") { + case "deploy": + p := spec.Placement + if p == nil { + BadRequest(w, "com.vmware.vapi.std.errors.invalid_argument") + return + } + if p.Cluster == "" && p.Host == "" && p.ResourcePool == "" { + BadRequest(w, "com.vmware.vapi.std.errors.invalid_argument") + return + } + + ref, err := s.cloneVM(item.Template.Value, spec.Name, p, spec.DiskStorage) + if err != nil { + BadRequest(w, err.Error()) + return + } + OK(w, ref.Value) + default: + http.NotFound(w, r) + } +} + +func (s *handler) libraryItemCheckOuts(item *item, w http.ResponseWriter, r *http.Request) { + switch r.URL.Query().Get("action") { + case "check-out": + var spec struct { + *vcenter.CheckOut `json:"spec"` + } + if !s.decode(r, w, &spec) { + return + } + + ref, err := s.cloneVM(item.Template.Value, spec.Name, spec.Placement, nil) + if err != nil { + BadRequest(w, err.Error()) + return + } + OK(w, ref.Value) + case "check-in": + // TODO: increment ContentVersion + OK(w, "0") + default: + http.NotFound(w, r) + } +} + +// defaultSecurityPolicies generates the initial set of security policies always present on vCenter. +func defaultSecurityPolicies() []library.ContentSecurityPoliciesInfo { + policyID, _ := uuid.NewUUID() + return []library.ContentSecurityPoliciesInfo{ + { + ItemTypeRules: map[string]string{ + "ovf": "OVF_STRICT_VERIFICATION", + }, + Name: "OVF default policy", + Policy: policyID.String(), + }, + } +} + +func (s *handler) librarySecurityPolicies(w http.ResponseWriter, r *http.Request) { + switch r.Method { + case http.MethodGet: + StatusOK(w, s.Policies) + default: + w.WriteHeader(http.StatusMethodNotAllowed) + } +} + +func (s *handler) isValidSecurityPolicy(policy string) bool { + if policy == "" { + return true + } + + for _, p := range s.Policies { + if p.Policy == policy { + return true + } + } + return false +} + +func (s *handler) libraryTrustedCertificates(w http.ResponseWriter, r *http.Request) { + switch r.Method { + case http.MethodGet: + var res struct { + Certificates []library.TrustedCertificateSummary `json:"certificates"` + } + for id, cert := range s.Trust { + res.Certificates = append(res.Certificates, library.TrustedCertificateSummary{ + TrustedCertificate: cert, + ID: id, + }) + } + + StatusOK(w, &res) + case http.MethodPost: + var info library.TrustedCertificate + if s.decode(r, w, &info) { + block, _ := pem.Decode([]byte(info.Text)) + if block == nil { + s.error(w, errors.New("invalid certificate")) + return + } + _, err := x509.ParseCertificate(block.Bytes) + if err != nil { + s.error(w, err) + return + } + + id := uuid.New().String() + for x, cert := range s.Trust { + if info.Text == cert.Text { + id = x // existing certificate + break + } + } + s.Trust[id] = info + + w.WriteHeader(http.StatusCreated) + } + default: + w.WriteHeader(http.StatusMethodNotAllowed) + } +} + +func (s *handler) libraryTrustedCertificatesID(w http.ResponseWriter, r *http.Request) { + id := path.Base(r.URL.Path) + cert, ok := s.Trust[id] + if !ok { + http.NotFound(w, r) + return + } + + switch r.Method { + case http.MethodGet: + StatusOK(w, &cert) + case http.MethodDelete: + delete(s.Trust, id) + default: + w.WriteHeader(http.StatusMethodNotAllowed) + } +} + +func (s *handler) vmID(w http.ResponseWriter, r *http.Request) { + id := path.Base(r.URL.Path) + + switch r.Method { + case http.MethodDelete: + s.deleteVM(&types.ManagedObjectReference{Type: "VirtualMachine", Value: id}) + default: + http.NotFound(w, r) + } +} + +func (s *handler) debugEcho(w http.ResponseWriter, r *http.Request) { + r.Write(w) +} diff --git a/vendor/github.com/vmware/govmomi/vapi/tags/categories.go b/vendor/github.com/vmware/govmomi/vapi/tags/categories.go index 119b9650621..64d0b66c16c 100644 --- a/vendor/github.com/vmware/govmomi/vapi/tags/categories.go +++ b/vendor/github.com/vmware/govmomi/vapi/tags/categories.go @@ -20,11 +20,13 @@ import ( "context" "fmt" "net/http" + "strings" "github.com/vmware/govmomi/vapi/internal" ) -// Category provides methods to create, read, update, delete, and enumerate categories. +// Category provides methods to create, read, update, delete, and enumerate +// categories. type Category struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` @@ -87,12 +89,13 @@ func (c *Manager) CreateCategory(ctx context.Context, category *Category) (strin // otherwise create fails with invalid_argument spec.Category.AssociableTypes = []string{} } - url := internal.URL(c, internal.CategoryPath) + url := c.Resource(internal.CategoryPath) var res string return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) } -// UpdateCategory can update one or more of the AssociableTypes, Cardinality, Description and Name fields. +// UpdateCategory updates one or more of the AssociableTypes, Cardinality, +// Description and Name fields. func (c *Manager) UpdateCategory(ctx context.Context, category *Category) error { spec := struct { Category Category `json:"update_spec"` @@ -104,13 +107,13 @@ func (c *Manager) UpdateCategory(ctx context.Context, category *Category) error Name: category.Name, }, } - url := internal.URL(c, internal.CategoryPath).WithID(category.ID) + url := c.Resource(internal.CategoryPath).WithID(category.ID) return c.Do(ctx, url.Request(http.MethodPatch, spec), nil) } -// DeleteCategory deletes an existing category. +// DeleteCategory deletes a category. func (c *Manager) DeleteCategory(ctx context.Context, category *Category) error { - url := internal.URL(c, internal.CategoryPath).WithID(category.ID) + url := c.Resource(internal.CategoryPath).WithID(category.ID) return c.Do(ctx, url.Request(http.MethodDelete), nil) } @@ -129,19 +132,19 @@ func (c *Manager) GetCategory(ctx context.Context, id string) (*Category, error) } } } - url := internal.URL(c, internal.CategoryPath).WithID(id) + url := c.Resource(internal.CategoryPath).WithID(id) var res Category return &res, c.Do(ctx, url.Request(http.MethodGet), &res) } // ListCategories returns all category IDs in the system. func (c *Manager) ListCategories(ctx context.Context) ([]string, error) { - url := internal.URL(c, internal.CategoryPath) + url := c.Resource(internal.CategoryPath) var res []string return res, c.Do(ctx, url.Request(http.MethodGet), &res) } -// GetCategories fetches an array of category information in the system. +// GetCategories fetches a list of category information in the system. func (c *Manager) GetCategories(ctx context.Context) ([]Category, error) { ids, err := c.ListCategories(ctx) if err != nil { @@ -152,11 +155,13 @@ func (c *Manager) GetCategories(ctx context.Context) ([]Category, error) { for _, id := range ids { category, err := c.GetCategory(ctx, id) if err != nil { - return nil, fmt.Errorf("get category %s: %s", id, err) + if strings.Contains(err.Error(), http.StatusText(http.StatusNotFound)) { + continue // deleted since last fetch + } + return nil, fmt.Errorf("get category %s: %v", id, err) } - categories = append(categories, *category) - } + return categories, nil } diff --git a/vendor/github.com/vmware/govmomi/vapi/tags/errors.go b/vendor/github.com/vmware/govmomi/vapi/tags/errors.go new file mode 100644 index 00000000000..b3f84f842f4 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/tags/errors.go @@ -0,0 +1,55 @@ +/* +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 tags + +import ( + "fmt" +) + +const ( + errFormat = "[error: %d type: %s reason: %s]" + separator = "," // concat multiple error strings +) + +// BatchError is an error returned for a single item which failed in a batch +// operation +type BatchError struct { + Type string `json:"id"` + Message string `json:"default_message"` +} + +// BatchErrors contains all errors which occurred in a batch operation +type BatchErrors []BatchError + +func (b BatchErrors) Error() string { + if len(b) == 0 { + return "" + } + + var errString string + for i := range b { + errType := b[i].Type + reason := b[i].Message + errString += fmt.Sprintf(errFormat, i, errType, reason) + + // no separator after last item + if i+1 < len(b) { + errString += separator + } + } + return errString +} diff --git a/vendor/github.com/vmware/govmomi/vapi/tags/tag_association.go b/vendor/github.com/vmware/govmomi/vapi/tags/tag_association.go index 1e1434186f0..33b22093661 100644 --- a/vendor/github.com/vmware/govmomi/vapi/tags/tag_association.go +++ b/vendor/github.com/vmware/govmomi/vapi/tags/tag_association.go @@ -18,6 +18,7 @@ package tags import ( "context" + "encoding/json" "fmt" "net/http" @@ -43,7 +44,7 @@ func (c *Manager) AttachTag(ctx context.Context, tagID string, ref mo.Reference) return err } spec := internal.NewAssociation(ref) - url := internal.URL(c, internal.AssociationPath).WithID(id).WithAction("attach") + url := c.Resource(internal.AssociationPath).WithID(id).WithAction("attach") return c.Do(ctx, url.Request(http.MethodPost, spec), nil) } @@ -55,14 +56,146 @@ func (c *Manager) DetachTag(ctx context.Context, tagID string, ref mo.Reference) return err } spec := internal.NewAssociation(ref) - url := internal.URL(c, internal.AssociationPath).WithID(id).WithAction("detach") + url := c.Resource(internal.AssociationPath).WithID(id).WithAction("detach") return c.Do(ctx, url.Request(http.MethodPost, spec), nil) } +// batchResponse is the response type used by attach/detach operations which +// take multiple tagIDs or moRefs as input. On failure Success will be false and +// Errors contains information about all failed operations +type batchResponse struct { + Success bool `json:"success"` + Errors BatchErrors `json:"error_messages,omitempty"` +} + +// AttachTagToMultipleObjects attaches a tag ID to multiple managed objects. +// This operation is idempotent, i.e. if a tag is already attached to the +// object, then the individual operation is a no-op and no error will be thrown. +// +// This operation was added in vSphere API 6.5. +func (c *Manager) AttachTagToMultipleObjects(ctx context.Context, tagID string, refs []mo.Reference) error { + id, err := c.tagID(ctx, tagID) + if err != nil { + return err + } + + var ids []internal.AssociatedObject + for i := range refs { + ids = append(ids, internal.AssociatedObject(refs[i].Reference())) + } + + spec := struct { + ObjectIDs []internal.AssociatedObject `json:"object_ids"` + }{ids} + + url := c.Resource(internal.AssociationPath).WithID(id).WithAction("attach-tag-to-multiple-objects") + return c.Do(ctx, url.Request(http.MethodPost, spec), nil) +} + +// AttachMultipleTagsToObject attaches multiple tag IDs to a managed object. +// This operation is idempotent. If a tag is already attached to the object, +// then the individual operation is a no-op and no error will be thrown. This +// operation is not atomic. If the underlying call fails with one or more tags +// not successfully attached to the managed object reference it might leave the +// managed object reference in a partially tagged state and needs to be resolved +// by the caller. In this case BatchErrors is returned and can be used to +// analyse failure reasons on each failed tag. +// +// Specified tagIDs must use URN-notation instead of display names or a generic +// error will be returned and no tagging operation will be performed. If the +// managed object reference does not exist a generic 403 Forbidden error will be +// returned. +// +// This operation was added in vSphere API 6.5. +func (c *Manager) AttachMultipleTagsToObject(ctx context.Context, tagIDs []string, ref mo.Reference) error { + for _, id := range tagIDs { + // URN enforced to avoid unnecessary round-trips due to invalid tags or display + // name lookups + if isName(id) { + return fmt.Errorf("specified tag is not a URN: %q", id) + } + } + + obj := internal.AssociatedObject(ref.Reference()) + spec := struct { + ObjectID internal.AssociatedObject `json:"object_id"` + TagIDs []string `json:"tag_ids"` + }{ + ObjectID: obj, + TagIDs: tagIDs, + } + + var res batchResponse + url := c.Resource(internal.AssociationPath).WithAction("attach-multiple-tags-to-object") + err := c.Do(ctx, url.Request(http.MethodPost, spec), &res) + if err != nil { + return err + } + + if !res.Success { + if len(res.Errors) != 0 { + return res.Errors + } + panic("invalid batch error") + } + + return nil +} + +// DetachMultipleTagsFromObject detaches multiple tag IDs from a managed object. +// This operation is idempotent. If a tag is already detached from the object, +// then the individual operation is a no-op and no error will be thrown. This +// operation is not atomic. If the underlying call fails with one or more tags +// not successfully detached from the managed object reference it might leave +// the managed object reference in a partially tagged state and needs to be +// resolved by the caller. In this case BatchErrors is returned and can be used +// to analyse failure reasons on each failed tag. +// +// Specified tagIDs must use URN-notation instead of display names or a generic +// error will be returned and no tagging operation will be performed. If the +// managed object reference does not exist a generic 403 Forbidden error will be +// returned. +// +// This operation was added in vSphere API 6.5. +func (c *Manager) DetachMultipleTagsFromObject(ctx context.Context, tagIDs []string, ref mo.Reference) error { + for _, id := range tagIDs { + // URN enforced to avoid unnecessary round-trips due to invalid tags or display + // name lookups + if isName(id) { + return fmt.Errorf("specified tag is not a URN: %q", id) + } + } + + obj := internal.AssociatedObject(ref.Reference()) + spec := struct { + ObjectID internal.AssociatedObject `json:"object_id"` + TagIDs []string `json:"tag_ids"` + }{ + ObjectID: obj, + TagIDs: tagIDs, + } + + var res batchResponse + url := c.Resource(internal.AssociationPath).WithAction("detach-multiple-tags-from-object") + err := c.Do(ctx, url.Request(http.MethodPost, spec), &res) + if err != nil { + return err + } + + if !res.Success { + if len(res.Errors) != 0 { + return res.Errors + } + panic("invalid batch error") + } + + return nil +} + // ListAttachedTags fetches the array of tag IDs attached to the given object. func (c *Manager) ListAttachedTags(ctx context.Context, ref mo.Reference) ([]string, error) { spec := internal.NewAssociation(ref) - url := internal.URL(c, internal.AssociationPath).WithAction("list-attached-tags") + url := c.Resource(internal.AssociationPath).WithAction("list-attached-tags") var res []string return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) } @@ -91,7 +224,7 @@ func (c *Manager) ListAttachedObjects(ctx context.Context, tagID string) ([]mo.R if err != nil { return nil, err } - url := internal.URL(c, internal.AssociationPath).WithID(id).WithAction("list-attached-objects") + url := c.Resource(internal.AssociationPath).WithID(id).WithAction("list-attached-objects") var res []internal.AssociatedObject if err := c.Do(ctx, url.Request(http.MethodPost, nil), &res); err != nil { return nil, err @@ -103,3 +236,142 @@ func (c *Manager) ListAttachedObjects(ctx context.Context, tagID string) ([]mo.R } return refs, nil } + +// AttachedObjects is the response type used by ListAttachedObjectsOnTags. +type AttachedObjects struct { + TagID string `json:"tag_id"` + Tag *Tag `json:"tag,omitempty"` + ObjectIDs []mo.Reference `json:"object_ids"` +} + +// UnmarshalJSON implements json.Unmarshaler. +func (t *AttachedObjects) UnmarshalJSON(b []byte) error { + var o struct { + TagID string `json:"tag_id"` + ObjectIDs []internal.AssociatedObject `json:"object_ids"` + } + err := json.Unmarshal(b, &o) + if err != nil { + return err + } + + t.TagID = o.TagID + t.ObjectIDs = make([]mo.Reference, len(o.ObjectIDs)) + for i := range o.ObjectIDs { + t.ObjectIDs[i] = o.ObjectIDs[i] + } + + return nil +} + +// ListAttachedObjectsOnTags fetches the array of attached objects for the given tag IDs. +func (c *Manager) ListAttachedObjectsOnTags(ctx context.Context, tagID []string) ([]AttachedObjects, error) { + var ids []string + for i := range tagID { + id, err := c.tagID(ctx, tagID[i]) + if err != nil { + return nil, err + } + ids = append(ids, id) + } + + spec := struct { + TagIDs []string `json:"tag_ids"` + }{ids} + + url := c.Resource(internal.AssociationPath).WithAction("list-attached-objects-on-tags") + var res []AttachedObjects + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// GetAttachedObjectsOnTags combines ListAttachedObjectsOnTags and populates each Tag field. +func (c *Manager) GetAttachedObjectsOnTags(ctx context.Context, tagID []string) ([]AttachedObjects, error) { + objs, err := c.ListAttachedObjectsOnTags(ctx, tagID) + if err != nil { + return nil, fmt.Errorf("list attached objects %s: %s", tagID, err) + } + + tags := make(map[string]*Tag) + + for i := range objs { + var err error + id := objs[i].TagID + tag, ok := tags[id] + if !ok { + tag, err = c.GetTag(ctx, id) + if err != nil { + return nil, fmt.Errorf("get tag %s: %s", id, err) + } + objs[i].Tag = tag + } + } + + return objs, nil +} + +// AttachedTags is the response type used by ListAttachedTagsOnObjects. +type AttachedTags struct { + ObjectID mo.Reference `json:"object_id"` + TagIDs []string `json:"tag_ids"` + Tags []Tag `json:"tags,omitempty"` +} + +// UnmarshalJSON implements json.Unmarshaler. +func (t *AttachedTags) UnmarshalJSON(b []byte) error { + var o struct { + ObjectID internal.AssociatedObject `json:"object_id"` + TagIDs []string `json:"tag_ids"` + } + err := json.Unmarshal(b, &o) + if err != nil { + return err + } + + t.ObjectID = o.ObjectID + t.TagIDs = o.TagIDs + + return nil +} + +// ListAttachedTagsOnObjects fetches the array of attached tag IDs for the given object IDs. +func (c *Manager) ListAttachedTagsOnObjects(ctx context.Context, objectID []mo.Reference) ([]AttachedTags, error) { + var ids []internal.AssociatedObject + for i := range objectID { + ids = append(ids, internal.AssociatedObject(objectID[i].Reference())) + } + + spec := struct { + ObjectIDs []internal.AssociatedObject `json:"object_ids"` + }{ids} + + url := c.Resource(internal.AssociationPath).WithAction("list-attached-tags-on-objects") + var res []AttachedTags + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// GetAttachedTagsOnObjects calls ListAttachedTagsOnObjects and populates each Tags field. +func (c *Manager) GetAttachedTagsOnObjects(ctx context.Context, objectID []mo.Reference) ([]AttachedTags, error) { + objs, err := c.ListAttachedTagsOnObjects(ctx, objectID) + if err != nil { + return nil, fmt.Errorf("list attached tags %s: %s", objectID, err) + } + + tags := make(map[string]*Tag) + + for i := range objs { + for _, id := range objs[i].TagIDs { + var err error + tag, ok := tags[id] + if !ok { + tag, err = c.GetTag(ctx, id) + if err != nil { + return nil, fmt.Errorf("get tag %s: %s", id, err) + } + tags[id] = tag + } + objs[i].Tags = append(objs[i].Tags, *tag) + } + } + + return objs, nil +} diff --git a/vendor/github.com/vmware/govmomi/vapi/tags/tags.go b/vendor/github.com/vmware/govmomi/vapi/tags/tags.go index 8e3c0a6cac3..b9024f998a2 100644 --- a/vendor/github.com/vmware/govmomi/vapi/tags/tags.go +++ b/vendor/github.com/vmware/govmomi/vapi/tags/tags.go @@ -90,7 +90,7 @@ func (c *Manager) CreateTag(ctx context.Context, tag *Tag) (string, error) { } spec.Tag.CategoryID = cat.ID } - url := internal.URL(c, internal.TagPath) + url := c.Resource(internal.TagPath) var res string return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) } @@ -105,13 +105,13 @@ func (c *Manager) UpdateTag(ctx context.Context, tag *Tag) error { Description: tag.Description, }, } - url := internal.URL(c, internal.TagPath).WithID(tag.ID) + url := c.Resource(internal.TagPath).WithID(tag.ID) return c.Do(ctx, url.Request(http.MethodPatch, spec), nil) } // DeleteTag deletes an existing tag. func (c *Manager) DeleteTag(ctx context.Context, tag *Tag) error { - url := internal.URL(c, internal.TagPath).WithID(tag.ID) + url := c.Resource(internal.TagPath).WithID(tag.ID) return c.Do(ctx, url.Request(http.MethodDelete), nil) } @@ -131,7 +131,7 @@ func (c *Manager) GetTag(ctx context.Context, id string) (*Tag, error) { } } - url := internal.URL(c, internal.TagPath).WithID(id) + url := c.Resource(internal.TagPath).WithID(id) var res Tag return &res, c.Do(ctx, url.Request(http.MethodGet), &res) @@ -148,10 +148,10 @@ func (c *Manager) GetTagForCategory(ctx context.Context, id, category string) (* return nil, err } - for _, id := range ids { - tag, err := c.GetTag(ctx, id) + for _, tagid := range ids { + tag, err := c.GetTag(ctx, tagid) if err != nil { - return nil, fmt.Errorf("get tag for category %s %s: %s", category, id, err) + return nil, fmt.Errorf("get tag for category %s %s: %s", category, tagid, err) } if tag.ID == id || tag.Name == id { return tag, nil @@ -163,7 +163,7 @@ func (c *Manager) GetTagForCategory(ctx context.Context, id, category string) (* // ListTags returns all tag IDs in the system. func (c *Manager) ListTags(ctx context.Context) ([]string, error) { - url := internal.URL(c, internal.TagPath) + url := c.Resource(internal.TagPath) var res []string return res, c.Do(ctx, url.Request(http.MethodGet), &res) } @@ -201,7 +201,7 @@ func (c *Manager) ListTagsForCategory(ctx context.Context, id string) ([]string, body := struct { ID string `json:"category_id"` }{id} - url := internal.URL(c, internal.TagPath).WithID(id).WithAction("list-tags-for-category") + url := c.Resource(internal.TagPath).WithID(id).WithAction("list-tags-for-category") var res []string return res, c.Do(ctx, url.Request(http.MethodPost, body), &res) } diff --git a/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_ovf.go b/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_ovf.go new file mode 100644 index 00000000000..80f0d38c313 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_ovf.go @@ -0,0 +1,311 @@ +/* +Copyright (c) 2018 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package vcenter + +import ( + "context" + "fmt" + "net/http" + + "github.com/vmware/govmomi/vapi/internal" + "github.com/vmware/govmomi/vapi/rest" + "github.com/vmware/govmomi/vim25/types" +) + +// AdditionalParams are additional OVF parameters which can be specified for a deployment target. +// This structure is a union where based on Type, only one of each commented section will be set. +type AdditionalParams struct { + Class string `json:"@class"` + Type string `json:"type"` + + // DeploymentOptionParams + SelectedKey string `json:"selected_key,omitempty"` + DeploymentOptions []DeploymentOption `json:"deployment_options,omitempty"` + + // ExtraConfigs + ExtraConfig []ExtraConfig `json:"extra_configs,omitempty"` + + // PropertyParams + Properties []Property `json:"properties,omitempty"` + + // SizeParams + ApproximateSparseDeploymentSize int64 `json:"approximate_sparse_deployment_size,omitempty"` + VariableDiskSize bool `json:"variable_disk_size,omitempty"` + ApproximateDownloadSize int64 `json:"approximate_download_size,omitempty"` + ApproximateFlatDeploymentSize int64 `json:"approximate_flat_deployment_size,omitempty"` + + // IpAllocationParams + SupportedAllocationScheme []string `json:"supported_allocation_scheme,omitempty"` + SupportedIPProtocol []string `json:"supported_ip_protocol,omitempty"` + SupportedIPAllocationPolicy []string `json:"supported_ip_allocation_policy,omitempty"` + IPAllocationPolicy string `json:"ip_allocation_policy,omitempty"` + IPProtocol string `json:"ip_protocol,omitempty"` + + // UnknownSections + UnknownSections []UnknownSection `json:"unknown_sections,omitempty"` +} + +const ( + ClassDeploymentOptionParams = "com.vmware.vcenter.ovf.deployment_option_params" + ClassPropertyParams = "com.vmware.vcenter.ovf.property_params" + TypeDeploymentOptionParams = "DeploymentOptionParams" + TypeExtraConfigParams = "ExtraConfigParams" + TypeIPAllocationParams = "IpAllocationParams" + TypePropertyParams = "PropertyParams" + TypeSizeParams = "SizeParams" +) + +// DeploymentOption contains the information about a deployment option as defined in the OVF specification +type DeploymentOption struct { + Key string `json:"key,omitempty"` + Label string `json:"label,omitempty"` + Description string `json:"description,omitempty"` + DefaultChoice bool `json:"default_choice,omitempty"` +} + +// ExtraConfig contains information about a vmw:ExtraConfig OVF element +type ExtraConfig struct { + Key string `json:"key,omitempty"` + Value string `json:"value,omitempty"` + VirtualSystemID string `json:"virtual_system_id,omitempty"` +} + +// Property contains information about a property in an OVF package +type Property struct { + Category string `json:"category,omitempty"` + ClassID string `json:"class_id,omitempty"` + Description string `json:"description,omitempty"` + ID string `json:"id,omitempty"` + InstanceID string `json:"instance_id,omitempty"` + Label string `json:"label,omitempty"` + Type string `json:"type,omitempty"` + UIOptional bool `json:"ui_optional,omitempty"` + Value string `json:"value,omitempty"` +} + +// UnknownSection contains information about an unknown section in an OVF package +type UnknownSection struct { + Tag string `json:"tag,omitempty"` + Info string `json:"info,omitempty"` +} + +// NetworkMapping specifies the target network to use for sections of type ovf:NetworkSection in the OVF descriptor +type NetworkMapping struct { + Key string `json:"key"` + Value string `json:"value"` +} + +// StorageGroupMapping defines the storage deployment target and storage provisioning type for a section of type vmw:StorageGroupSection in the OVF descriptor +type StorageGroupMapping struct { + Type string `json:"type"` + StorageProfileID string `json:"storage_profile_id,omitempty"` + DatastoreID string `json:"datastore_id,omitempty"` + Provisioning string `json:"provisioning,omitempty"` +} + +// StorageMapping specifies the target storage to use for sections of type vmw:StorageGroupSection in the OVF descriptor +type StorageMapping struct { + Key string `json:"key"` + Value StorageGroupMapping `json:"value"` +} + +// VmConfigSpec defines the optional virtual machine configuration settings used when deploying an OVF template +type VmConfigSpec struct { + Provider string `json:"provider"` + XML string `json:"xml"` +} + +// DeploymentSpec is the deployment specification for the deployment +type DeploymentSpec struct { + Name string `json:"name,omitempty"` + Annotation string `json:"annotation,omitempty"` + AcceptAllEULA bool `json:"accept_all_EULA,omitempty"` + NetworkMappings []NetworkMapping `json:"network_mappings,omitempty"` + StorageMappings []StorageMapping `json:"storage_mappings,omitempty"` + StorageProvisioning string `json:"storage_provisioning,omitempty"` + StorageProfileID string `json:"storage_profile_id,omitempty"` + Locale string `json:"locale,omitempty"` + Flags []string `json:"flags,omitempty"` + AdditionalParams []AdditionalParams `json:"additional_parameters,omitempty"` + DefaultDatastoreID string `json:"default_datastore_id,omitempty"` + VmConfigSpec *VmConfigSpec `json:"vm_config_spec,omitempty"` +} + +// Target is the target for the deployment +type Target struct { + ResourcePoolID string `json:"resource_pool_id,omitempty"` + HostID string `json:"host_id,omitempty"` + FolderID string `json:"folder_id,omitempty"` +} + +// Deploy contains the information to start the deployment of a library OVF +type Deploy struct { + DeploymentSpec `json:"deployment_spec,omitempty"` + Target `json:"target,omitempty"` +} + +// Error is a SERVER error +type Error struct { + Class string `json:"@class,omitempty"` + Messages []rest.LocalizableMessage `json:"messages,omitempty"` +} + +// ParseIssue is a parse issue struct +type ParseIssue struct { + Category string `json:"@classcategory,omitempty"` + File string `json:"file,omitempty"` + LineNumber int64 `json:"line_number,omitempty"` + ColumnNumber int64 `json:"column_number,omitempty"` + Message rest.LocalizableMessage `json:"message,omitempty"` +} + +// OVFError is a list of errors from create or deploy +type OVFError struct { + Category string `json:"category,omitempty"` + Error *Error `json:"error,omitempty"` + Issues []ParseIssue `json:"issues,omitempty"` + Message *rest.LocalizableMessage `json:"message,omitempty"` +} + +// ResourceID is a managed object reference for a deployed resource. +type ResourceID struct { + Type string `json:"type,omitempty"` + Value string `json:"id,omitempty"` +} + +// DeploymentError is an error that occurs when deploying and OVF from +// a library item. +type DeploymentError struct { + Errors []OVFError `json:"errors,omitempty"` +} + +// Error implements the error interface +func (e *DeploymentError) Error() string { + msg := "" + if len(e.Errors) != 0 { + err := e.Errors[0] + if err.Message != nil { + msg = err.Message.DefaultMessage + } else if err.Error != nil && len(err.Error.Messages) != 0 { + msg = err.Error.Messages[0].DefaultMessage + } + } + if msg == "" { + msg = fmt.Sprintf("%#v", e) + } + return "deploy error: " + msg +} + +// LibraryTarget specifies a Library or Library item +type LibraryTarget struct { + LibraryID string `json:"library_id,omitempty"` + LibraryItemID string `json:"library_item_id,omitempty"` +} + +// CreateSpec info used to create an OVF package from a VM +type CreateSpec struct { + Description string `json:"description,omitempty"` + Name string `json:"name,omitempty"` + Flags []string `json:"flags,omitempty"` +} + +// OVF data used by CreateOVF +type OVF struct { + Spec CreateSpec `json:"create_spec"` + Source ResourceID `json:"source"` + Target LibraryTarget `json:"target"` +} + +// CreateResult used for decoded a CreateOVF response +type CreateResult struct { + Succeeded bool `json:"succeeded,omitempty"` + ID string `json:"ovf_library_item_id,omitempty"` + Error *DeploymentError `json:"error,omitempty"` +} + +// Deployment is the results from issuing a library OVF deployment +type Deployment struct { + Succeeded bool `json:"succeeded,omitempty"` + ResourceID *ResourceID `json:"resource_id,omitempty"` + Error *DeploymentError `json:"error,omitempty"` +} + +// FilterRequest contains the information to start a vcenter filter call +type FilterRequest struct { + Target `json:"target,omitempty"` +} + +// FilterResponse returns information from the vcenter filter call +type FilterResponse struct { + EULAs []string `json:"EULAs,omitempty"` + AdditionalParams []AdditionalParams `json:"additional_params,omitempty"` + Annotation string `json:"Annotation,omitempty"` + Name string `json:"name,omitempty"` + Networks []string `json:"Networks,omitempty"` + StorageGroups []string `json:"storage_groups,omitempty"` +} + +// Manager extends rest.Client, adding content library related methods. +type Manager struct { + *rest.Client +} + +// NewManager creates a new Manager instance with the given client. +func NewManager(client *rest.Client) *Manager { + return &Manager{ + Client: client, + } +} + +// CreateOVF creates a library OVF item in content library from an existing VM +func (c *Manager) CreateOVF(ctx context.Context, ovf OVF) (string, error) { + if ovf.Source.Type == "" { + ovf.Source.Type = "VirtualMachine" + } + url := c.Resource(internal.VCenterOVFLibraryItem) + var res CreateResult + err := c.Do(ctx, url.Request(http.MethodPost, ovf), &res) + if err != nil { + return "", err + } + if res.Succeeded { + return res.ID, nil + } + return "", res.Error +} + +// DeployLibraryItem deploys a library OVF +func (c *Manager) DeployLibraryItem(ctx context.Context, libraryItemID string, deploy Deploy) (*types.ManagedObjectReference, error) { + url := c.Resource(internal.VCenterOVFLibraryItem).WithID(libraryItemID).WithAction("deploy") + var res Deployment + err := c.Do(ctx, url.Request(http.MethodPost, deploy), &res) + if err != nil { + return nil, err + } + if res.Succeeded { + ref := types.ManagedObjectReference(*res.ResourceID) + return &ref, nil + } + return nil, res.Error +} + +// FilterLibraryItem deploys a library OVF +func (c *Manager) FilterLibraryItem(ctx context.Context, libraryItemID string, filter FilterRequest) (FilterResponse, error) { + url := c.Resource(internal.VCenterOVFLibraryItem).WithID(libraryItemID).WithAction("filter") + var res FilterResponse + return res, c.Do(ctx, url.Request(http.MethodPost, filter), &res) +} diff --git a/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_vmtx.go b/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_vmtx.go new file mode 100644 index 00000000000..fdb9b629c25 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vapi/vcenter/vcenter_vmtx.go @@ -0,0 +1,337 @@ +/* +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 vcenter + +import ( + "context" + "crypto/sha1" + "fmt" + "log" + "net/http" + "path" + + "github.com/vmware/govmomi/vapi/internal" + "github.com/vmware/govmomi/vapi/library" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +// vcenter vm template +// The vcenter.vm_template API provides structures and services that will let its client manage VMTX template in Content Library. +// http://vmware.github.io/vsphere-automation-sdk-rest/6.7.1/index.html#SVC_com.vmware.vcenter.vm_template.library_items + +// Template create spec +type Template struct { + Description string `json:"description,omitempty"` + DiskStorage *DiskStorage `json:"disk_storage,omitempty"` + DiskStorageOverrides []DiskStorageOverride `json:"disk_storage_overrides,omitempty"` + Library string `json:"library,omitempty"` + Name string `json:"name,omitempty"` + Placement *Placement `json:"placement,omitempty"` + SourceVM string `json:"source_vm,omitempty"` + VMHomeStorage *DiskStorage `json:"vm_home_storage,omitempty"` +} + +// CPU defines Cores and CPU count +type CPU struct { + CoresPerSocket int `json:"cores_per_socket,omitempty"` + Count int `json:"count,omitempty"` +} + +// DiskInfo defines disk capacity and storage info +type DiskInfo struct { + Capacity int `json:"capacity,omitempty"` + DiskStorage DiskStorage `json:"disk_storage,omitempty"` +} + +// Disks defines the disk information +type Disks struct { + Key string `json:"key"` + Value *DiskInfo `json:"value"` +} + +// Memory defines the memory size in MB +type Memory struct { + SizeMB int `json:"size_mib,omitempty"` +} + +// NicDetails defines the network adapter details +type NicDetails struct { + Network string `json:"network,omitempty"` + BackingType string `json:"backing_type,omitempty"` + MacType string `json:"mac_type,omitempty"` +} + +// Nics defines the network identifier +type Nics struct { + Key string `json:"key,omitempty"` + Value *NicDetails `json:"value,omitempty"` +} + +// TemplateInfo for a VM template contained in an existing library item +type TemplateInfo struct { + CPU CPU `json:"cpu,omitempty"` + Disks []Disks `json:"disks,omitempty"` + GuestOS string `json:"guest_OS,omitempty"` + Memory Memory `json:"memory,omitempty"` + Nics []Nics `json:"nics,omitempty"` + VMHomeStorage DiskStorage `json:"vm_home_storage,omitempty"` + VmTemplate string `json:"vm_template,omitempty"` +} + +// Placement information used to place the virtual machine template +type Placement = library.Placement + +// StoragePolicy for DiskStorage +type StoragePolicy struct { + Policy string `json:"policy,omitempty"` + Type string `json:"type"` +} + +// DiskStorage defines the storage specification for VM files +type DiskStorage struct { + Datastore string `json:"datastore,omitempty"` + StoragePolicy *StoragePolicy `json:"storage_policy,omitempty"` +} + +// DiskStorageOverride storage specification for individual disks in the virtual machine template +type DiskStorageOverride struct { + Key string `json:"key"` + Value DiskStorage `json:"value"` +} + +// GuestCustomization spec to apply to the deployed VM +type GuestCustomization struct { + Name string `json:"name,omitempty"` +} + +// HardwareCustomization spec which specifies updates to the deployed VM +type HardwareCustomization struct { + // TODO +} + +// DeployTemplate specification of how a library VM template clone should be deployed. +type DeployTemplate struct { + Description string `json:"description,omitempty"` + DiskStorage *DiskStorage `json:"disk_storage,omitempty"` + DiskStorageOverrides []DiskStorageOverride `json:"disk_storage_overrides,omitempty"` + GuestCustomization *GuestCustomization `json:"guest_customization,omitempty"` + HardwareCustomization *HardwareCustomization `json:"hardware_customization,omitempty"` + Name string `json:"name,omitempty"` + Placement *Placement `json:"placement,omitempty"` + PoweredOn bool `json:"powered_on"` + VMHomeStorage *DiskStorage `json:"vm_home_storage,omitempty"` +} + +// CheckOut specification +type CheckOut struct { + Name string `json:"name,omitempty"` + Placement *Placement `json:"placement,omitempty"` + PoweredOn bool `json:"powered_on,omitempty"` +} + +// CheckIn specification +type CheckIn struct { + Message string `json:"message"` +} + +// CreateTemplate creates a library VMTX item in content library from an existing VM +func (c *Manager) CreateTemplate(ctx context.Context, vmtx Template) (string, error) { + url := c.Resource(internal.VCenterVMTXLibraryItem) + var res string + spec := struct { + Template `json:"spec"` + }{vmtx} + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// GetLibraryTemplateInfo fetches the library template info using template library id +func (c *Manager) GetLibraryTemplateInfo(ctx context.Context, libraryItemID string) (*TemplateInfo, error) { + url := c.Resource(path.Join(internal.VCenterVMTXLibraryItem, libraryItemID)) + var res TemplateInfo + err := c.Do(ctx, url.Request(http.MethodGet), &res) + if err != nil { + return nil, err + } + return &res, nil +} + +// DeployTemplateLibraryItem deploys a VM as a copy of the source VM template contained in the given library item +func (c *Manager) DeployTemplateLibraryItem(ctx context.Context, libraryItemID string, deploy DeployTemplate) (*types.ManagedObjectReference, error) { + url := c.Resource(path.Join(internal.VCenterVMTXLibraryItem, libraryItemID)).WithParam("action", "deploy") + var res string + spec := struct { + DeployTemplate `json:"spec"` + }{deploy} + err := c.Do(ctx, url.Request(http.MethodPost, spec), &res) + if err != nil { + return nil, err + } + return &types.ManagedObjectReference{Type: "VirtualMachine", Value: res}, nil +} + +// CheckOut a library item containing a VM template. +func (c *Manager) CheckOut(ctx context.Context, libraryItemID string, checkout *CheckOut) (*types.ManagedObjectReference, error) { + url := c.Resource(path.Join(internal.VCenterVMTXLibraryItem, libraryItemID, "check-outs")).WithParam("action", "check-out") + var res string + spec := struct { + *CheckOut `json:"spec"` + }{checkout} + err := c.Do(ctx, url.Request(http.MethodPost, spec), &res) + if err != nil { + return nil, err + } + return &types.ManagedObjectReference{Type: "VirtualMachine", Value: res}, nil +} + +// CheckIn a VM into the library item. +func (c *Manager) CheckIn(ctx context.Context, libraryItemID string, vm mo.Reference, checkin *CheckIn) (string, error) { + p := path.Join(internal.VCenterVMTXLibraryItem, libraryItemID, "check-outs", vm.Reference().Value) + url := c.Resource(p).WithParam("action", "check-in") + var res string + spec := struct { + *CheckIn `json:"spec"` + }{checkin} + return res, c.Do(ctx, url.Request(http.MethodPost, spec), &res) +} + +// TemplateLibrary params for synchronizing subscription library OVF items to VM Template items +type TemplateLibrary struct { + Source library.Library + Destination library.Library + Placement Target + Include func(library.Item, *library.Item) bool + SyncItem func(context.Context, library.Item, *Deploy, *Template) error +} + +func (c *Manager) includeTemplateLibraryItem(src library.Item, dst *library.Item) bool { + return dst == nil +} + +// SyncTemplateLibraryItem deploys an Library OVF item from which a VM template (vmtx) Library item is created. +// The deployed VM is deleted after being converted to a Library vmtx item. +func (c *Manager) SyncTemplateLibraryItem(ctx context.Context, item library.Item, deploy *Deploy, spec *Template) error { + destroy := false + if spec.SourceVM == "" { + ref, err := c.DeployLibraryItem(ctx, item.ID, *deploy) + if err != nil { + return err + } + + destroy = true + spec.SourceVM = ref.Value + } + + _, err := c.CreateTemplate(ctx, *spec) + + if destroy { + // Delete source VM regardless of CreateTemplate result + url := c.Resource("/vcenter/vm/" + spec.SourceVM) + derr := c.Do(ctx, url.Request(http.MethodDelete), nil) + if derr != nil { + if err == nil { + // Return Delete error if CreateTemplate was successful + return derr + } + // Return CreateTemplate error and just log Delete error + log.Printf("destroy %s: %s", spec.SourceVM, derr) + } + } + + return err +} + +func vmtxSourceName(l library.Library, item library.Item) string { + sum := sha1.Sum([]byte(path.Join(l.Name, item.Name))) + return fmt.Sprintf("vmtx-src-%x", sum) +} + +// SyncTemplateLibrary converts TemplateLibrary.Source OVF items to VM Template items within TemplateLibrary.Destination +// The optional TemplateLibrary.Include func can be used to filter which items are synced. +// By default all items that don't exist in the Destination library are synced. +// The optional TemplateLibrary.SyncItem func can be used to change how the item is synced, by default SyncTemplateLibraryItem is used. +func (c *Manager) SyncTemplateLibrary(ctx context.Context, l TemplateLibrary, items ...library.Item) error { + m := library.NewManager(c.Client) + var err error + if len(items) == 0 { + items, err = m.GetLibraryItems(ctx, l.Source.ID) + if err != nil { + return err + } + } + + templates, err := m.GetLibraryItems(ctx, l.Destination.ID) + if err != nil { + return err + } + + existing := make(map[string]*library.Item) + for i := range templates { + existing[templates[i].Name] = &templates[i] + } + + include := l.Include + if include == nil { + include = c.includeTemplateLibraryItem + } + + sync := l.SyncItem + if sync == nil { + sync = c.SyncTemplateLibraryItem + } + + for _, item := range items { + if item.Type != library.ItemTypeOVF { + continue + } + + // Deploy source VM from library ovf item + deploy := Deploy{ + DeploymentSpec: DeploymentSpec{ + Name: vmtxSourceName(l.Destination, item), + DefaultDatastoreID: l.Destination.Storage[0].DatastoreID, + AcceptAllEULA: true, + }, + Target: l.Placement, + } + + // Create library vmtx item from source VM + storage := &DiskStorage{ + Datastore: deploy.DeploymentSpec.DefaultDatastoreID, + } + spec := Template{ + Name: item.Name, + Library: l.Destination.ID, + DiskStorage: storage, + VMHomeStorage: storage, + Placement: &Placement{ + Folder: deploy.Target.FolderID, + ResourcePool: deploy.Target.ResourcePoolID, + }, + } + + if !l.Include(item, existing[item.Name]) { + continue + } + + if err = sync(ctx, item, &deploy, &spec); err != nil { + return err + } + } + + return nil +} diff --git a/vendor/github.com/vmware/govmomi/view/container_view.go b/vendor/github.com/vmware/govmomi/view/container_view.go new file mode 100644 index 00000000000..39041c41f97 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/view/container_view.go @@ -0,0 +1,145 @@ +/* +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 view + +import ( + "context" + + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/mo" + "github.com/vmware/govmomi/vim25/types" +) + +type ContainerView struct { + ManagedObjectView +} + +func NewContainerView(c *vim25.Client, ref types.ManagedObjectReference) *ContainerView { + return &ContainerView{ + ManagedObjectView: *NewManagedObjectView(c, ref), + } +} + +// 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{}, pspec ...types.PropertySpec) error { + pc := property.DefaultCollector(v.Client()) + + ospec := types.ObjectSpec{ + Obj: v.Reference(), + Skip: types.NewBool(true), + SelectSet: []types.BaseSelectionSpec{ + &types.TraversalSpec{ + Type: v.Reference().Type, + Path: "view", + }, + }, + } + + if len(kind) == 0 { + kind = []string{"ManagedEntity"} + } + + for _, t := range kind { + spec := types.PropertySpec{ + Type: t, + } + + if len(ps) == 0 { + spec.All = types.NewBool(true) + } else { + spec.PathSet = ps + } + + pspec = append(pspec, spec) + } + + req := types.RetrieveProperties{ + SpecSet: []types.PropertyFilterSpec{ + { + ObjectSet: []types.ObjectSpec{ospec}, + PropSet: pspec, + }, + }, + } + + res, err := pc.RetrieveProperties(ctx, req) + if err != nil { + return err + } + + if d, ok := dst.(*[]types.ObjectContent); ok { + *d = res.Returnval + return nil + } + + return mo.LoadObjectContent(res.Returnval, dst) +} + +// RetrieveWithFilter populates dst as Retrieve does, but only for entities matching the given filter. +func (v ContainerView) RetrieveWithFilter(ctx context.Context, kind []string, ps []string, dst interface{}, filter property.Filter) error { + if len(filter) == 0 { + return v.Retrieve(ctx, kind, ps, dst) + } + + var content []types.ObjectContent + + err := v.Retrieve(ctx, kind, filter.Keys(), &content) + if err != nil { + return err + } + + objs := filter.MatchObjectContent(content) + + pc := property.DefaultCollector(v.Client()) + + return pc.Retrieve(ctx, objs, ps, dst) +} + +// Find returns object references for entities of type kind, matching the given filter. +func (v ContainerView) Find(ctx context.Context, kind []string, filter property.Filter) ([]types.ManagedObjectReference, error) { + if len(filter) == 0 { + // Ensure we have at least 1 filter to avoid retrieving all properties. + filter = property.Filter{"name": "*"} + } + + var content []types.ObjectContent + + err := v.Retrieve(ctx, kind, filter.Keys(), &content) + if err != nil { + return nil, err + } + + return filter.MatchObjectContent(content), nil +} + +// FindAny returns object references for entities of type kind, matching any property the given filter. +func (v ContainerView) FindAny(ctx context.Context, kind []string, filter property.Filter) ([]types.ManagedObjectReference, error) { + if len(filter) == 0 { + // Ensure we have at least 1 filter to avoid retrieving all properties. + filter = property.Filter{"name": "*"} + } + + var content []types.ObjectContent + + err := v.Retrieve(ctx, kind, filter.Keys(), &content) + if err != nil { + return nil, err + } + + return filter.MatchAnyObjectContent(content), nil +} diff --git a/vendor/github.com/vmware/govmomi/view/list_view.go b/vendor/github.com/vmware/govmomi/view/list_view.go new file mode 100644 index 00000000000..e8cfb504341 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/view/list_view.go @@ -0,0 +1,62 @@ +/* +Copyright (c) 2015-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 view + +import ( + "context" + + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" +) + +type ListView struct { + ManagedObjectView +} + +func NewListView(c *vim25.Client, ref types.ManagedObjectReference) *ListView { + return &ListView{ + ManagedObjectView: *NewManagedObjectView(c, ref), + } +} + +func (v ListView) Add(ctx context.Context, refs []types.ManagedObjectReference) error { + req := types.ModifyListView{ + This: v.Reference(), + Add: refs, + } + _, err := methods.ModifyListView(ctx, v.Client(), &req) + return err +} + +func (v ListView) Remove(ctx context.Context, refs []types.ManagedObjectReference) error { + req := types.ModifyListView{ + This: v.Reference(), + Remove: refs, + } + _, err := methods.ModifyListView(ctx, v.Client(), &req) + return err +} + +func (v ListView) Reset(ctx context.Context, refs []types.ManagedObjectReference) error { + req := types.ResetListView{ + This: v.Reference(), + Obj: refs, + } + _, err := methods.ResetListView(ctx, v.Client(), &req) + return err +} diff --git a/vendor/github.com/vmware/govmomi/view/managed_object_view.go b/vendor/github.com/vmware/govmomi/view/managed_object_view.go new file mode 100644 index 00000000000..805c8643107 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/view/managed_object_view.go @@ -0,0 +1,52 @@ +/* +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 view + +import ( + "context" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" +) + +type ManagedObjectView struct { + object.Common +} + +func NewManagedObjectView(c *vim25.Client, ref types.ManagedObjectReference) *ManagedObjectView { + return &ManagedObjectView{ + Common: object.NewCommon(c, ref), + } +} + +func (v *ManagedObjectView) TraversalSpec() *types.TraversalSpec { + return &types.TraversalSpec{ + Path: "view", + Type: v.Reference().Type, + } +} + +func (v *ManagedObjectView) Destroy(ctx context.Context) error { + req := types.DestroyView{ + This: v.Reference(), + } + + _, err := methods.DestroyView(ctx, v.Client(), &req) + return err +} diff --git a/vendor/github.com/vmware/govmomi/view/manager.go b/vendor/github.com/vmware/govmomi/view/manager.go new file mode 100644 index 00000000000..d44def0cd99 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/view/manager.go @@ -0,0 +1,69 @@ +/* +Copyright (c) 2015 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package view + +import ( + "context" + + "github.com/vmware/govmomi/object" + "github.com/vmware/govmomi/vim25" + "github.com/vmware/govmomi/vim25/methods" + "github.com/vmware/govmomi/vim25/types" +) + +type Manager struct { + object.Common +} + +func NewManager(c *vim25.Client) *Manager { + m := Manager{ + object.NewCommon(c, *c.ServiceContent.ViewManager), + } + + return &m +} + +func (m Manager) CreateListView(ctx context.Context, objects []types.ManagedObjectReference) (*ListView, error) { + req := types.CreateListView{ + This: m.Common.Reference(), + Obj: objects, + } + + res, err := methods.CreateListView(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return NewListView(m.Client(), res.Returnval), nil +} + +func (m Manager) CreateContainerView(ctx context.Context, container types.ManagedObjectReference, managedObjectTypes []string, recursive bool) (*ContainerView, error) { + + req := types.CreateContainerView{ + This: m.Common.Reference(), + Container: container, + Recursive: recursive, + Type: managedObjectTypes, + } + + res, err := methods.CreateContainerView(ctx, m.Client(), &req) + if err != nil { + return nil, err + } + + return NewContainerView(m.Client(), res.Returnval), nil +} diff --git a/vendor/github.com/vmware/govmomi/view/task_view.go b/vendor/github.com/vmware/govmomi/view/task_view.go new file mode 100644 index 00000000000..68f62f8d107 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/view/task_view.go @@ -0,0 +1,125 @@ +/* +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 view + +import ( + "context" + + "github.com/vmware/govmomi/property" + "github.com/vmware/govmomi/vim25/types" +) + +// TaskView extends ListView such that it can follow a ManagedEntity's recentTask updates. +type TaskView struct { + *ListView + + Follow bool + + Watch *types.ManagedObjectReference +} + +// CreateTaskView creates a new ListView that optionally watches for a ManagedEntity's recentTask updates. +func (m Manager) CreateTaskView(ctx context.Context, watch *types.ManagedObjectReference) (*TaskView, error) { + l, err := m.CreateListView(ctx, nil) + if err != nil { + return nil, err + } + + tv := &TaskView{ + ListView: l, + Watch: watch, + } + + return tv, nil +} + +// Collect calls function f for each Task update. +func (v TaskView) Collect(ctx context.Context, f func([]types.TaskInfo)) error { + // Using TaskHistoryCollector would be less clunky, but it isn't supported on ESX at all. + ref := v.Reference() + filter := new(property.WaitFilter).Add(ref, "Task", []string{"info"}, v.TraversalSpec()) + + if v.Watch != nil { + filter.Add(*v.Watch, v.Watch.Type, []string{"recentTask"}) + } + + pc := property.DefaultCollector(v.Client()) + + completed := make(map[string]bool) + + return property.WaitForUpdates(ctx, pc, filter, func(updates []types.ObjectUpdate) bool { + var infos []types.TaskInfo + var prune []types.ManagedObjectReference + var tasks []types.ManagedObjectReference + var reset func() + + for _, update := range updates { + for _, change := range update.ChangeSet { + if change.Name == "recentTask" { + tasks = change.Val.(types.ArrayOfManagedObjectReference).ManagedObjectReference + if len(tasks) != 0 { + reset = func() { + _ = v.Reset(ctx, tasks) + + // Remember any tasks we've reported as complete already, + // to avoid reporting multiple times when Reset is triggered. + rtasks := make(map[string]bool) + for i := range tasks { + if _, ok := completed[tasks[i].Value]; ok { + rtasks[tasks[i].Value] = true + } + } + completed = rtasks + } + } + + continue + } + + info, ok := change.Val.(types.TaskInfo) + if !ok { + continue + } + + if !completed[info.Task.Value] { + infos = append(infos, info) + } + + if v.Follow && info.CompleteTime != nil { + prune = append(prune, info.Task) + completed[info.Task.Value] = true + } + } + } + + if len(infos) != 0 { + f(infos) + } + + if reset != nil { + reset() + } else if len(prune) != 0 { + _ = v.Remove(ctx, prune) + } + + if len(tasks) != 0 && len(infos) == 0 { + return false + } + + return !v.Follow + }) +} diff --git a/vendor/github.com/vmware/govmomi/vim25/client.go b/vendor/github.com/vmware/govmomi/vim25/client.go index 1d26fb8b6a7..b14cea85202 100644 --- a/vendor/github.com/vmware/govmomi/vim25/client.go +++ b/vendor/github.com/vmware/govmomi/vim25/client.go @@ -19,16 +19,20 @@ package vim25 import ( "context" "encoding/json" + "fmt" + "net/http" + "path" "strings" "github.com/vmware/govmomi/vim25/methods" "github.com/vmware/govmomi/vim25/soap" "github.com/vmware/govmomi/vim25/types" + "github.com/vmware/govmomi/vim25/xml" ) const ( Namespace = "vim25" - Version = "6.7" + Version = "7.0" Path = "/sdk" ) @@ -54,7 +58,7 @@ type Client struct { RoundTripper soap.RoundTripper } -// NewClient creates and returns a new client wirh the ServiceContent field +// NewClient creates and returns a new client with the ServiceContent field // filled in. func NewClient(ctx context.Context, rt soap.RoundTripper) (*Client, error) { c := Client{ @@ -67,7 +71,7 @@ func NewClient(ctx context.Context, rt soap.RoundTripper) (*Client, error) { if c.Namespace == "" { c.Namespace = "urn:" + Namespace - } else if strings.Index(c.Namespace, ":") < 0 { + } else if !strings.Contains(c.Namespace, ":") { c.Namespace = "urn:" + c.Namespace // ensure valid URI format } if c.Version == "" { @@ -84,6 +88,42 @@ func NewClient(ctx context.Context, rt soap.RoundTripper) (*Client, error) { return &c, nil } +// UseServiceVersion sets soap.Client.Version to the current version of the service endpoint via /sdk/vimServiceVersions.xml +func (c *Client) UseServiceVersion(kind ...string) error { + ns := "vim" + if len(kind) != 0 { + ns = kind[0] + } + + u := c.URL() + u.Path = path.Join(Path, ns+"ServiceVersions.xml") + + res, err := c.Get(u.String()) + if err != nil { + return err + } + + if res.StatusCode != http.StatusOK { + return fmt.Errorf("http.Get(%s): %s", u.Path, err) + } + + v := struct { + Namespace *string `xml:"namespace>name"` + Version *string `xml:"namespace>version"` + }{ + &c.Namespace, + &c.Version, + } + + err = xml.NewDecoder(res.Body).Decode(&v) + _ = res.Body.Close() + if err != nil { + return fmt.Errorf("xml.Decode(%s): %s", u.Path, err) + } + + return 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) @@ -140,6 +180,11 @@ func (c *Client) Valid() bool { return true } +// Path returns vim25.Path (see cache.Client) +func (c *Client) Path() string { + return Path +} + // IsVC returns true if we are connected to a vCenter func (c *Client) IsVC() bool { return c.ServiceContent.About.ApiType == "VirtualCenter" diff --git a/vendor/github.com/vmware/govmomi/vim25/debug/debug.go b/vendor/github.com/vmware/govmomi/vim25/debug/debug.go index 22d54717846..048062825d5 100644 --- a/vendor/github.com/vmware/govmomi/vim25/debug/debug.go +++ b/vendor/github.com/vmware/govmomi/vim25/debug/debug.go @@ -18,8 +18,7 @@ package debug import ( "io" - "os" - "path" + "regexp" ) // Provider specified the interface types must implement to be used as a @@ -30,7 +29,22 @@ 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(`(.*)`) func SetProvider(p Provider) { if currentProvider != nil { @@ -54,28 +68,6 @@ func Flush() { currentProvider.Flush() } -// FileProvider implements a debugging provider that creates a real file for -// every call to NewFile. It maintains a list of all files that it creates, -// such that it can close them when its Flush function is called. -type FileProvider struct { - Path string - - files []*os.File -} - -func (fp *FileProvider) NewFile(p string) io.WriteCloser { - f, err := os.Create(path.Join(fp.Path, p)) - if err != nil { - panic(err) - } - - fp.files = append(fp.files, f) - - return f -} - -func (fp *FileProvider) Flush() { - for _, f := range fp.files { - f.Close() - } +func Scrub(in []byte) []byte { + return scrubPassword.ReplaceAll(in, []byte(`********`)) } diff --git a/vendor/github.com/vmware/govmomi/vim25/debug/file.go b/vendor/github.com/vmware/govmomi/vim25/debug/file.go new file mode 100644 index 00000000000..4290a29167f --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vim25/debug/file.go @@ -0,0 +1,75 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package debug + +import ( + "io" + "os" + "path" + "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 + + mu sync.Mutex + files []*os.File +} + +func (fp *FileProvider) NewFile(p string) io.WriteCloser { + f, err := os.Create(path.Join(fp.Path, p)) + if err != nil { + panic(err) + } + + fp.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() + } +} + +type FileWriterCloser struct { + f *os.File + p string +} + +func NewFileWriterCloser(f *os.File, p string) *FileWriterCloser { + return &FileWriterCloser{ + f, + p, + } +} + +func (fwc *FileWriterCloser) Write(p []byte) (n int, err error) { + return fwc.f.Write(Scrub(p)) +} + +func (fwc *FileWriterCloser) Close() error { + return fwc.f.Close() +} diff --git a/vendor/github.com/vmware/govmomi/vim25/debug/log.go b/vendor/github.com/vmware/govmomi/vim25/debug/log.go new file mode 100644 index 00000000000..183c606a3cb --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vim25/debug/log.go @@ -0,0 +1,49 @@ +/* +Copyright (c) 2014 VMware, Inc. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package debug + +import ( + "fmt" + "io" + "os" +) + +type LogWriterCloser struct { +} + +func NewLogWriterCloser() *LogWriterCloser { + return &LogWriterCloser{} +} + +func (lwc *LogWriterCloser) Write(p []byte) (n int, err error) { + fmt.Fprint(os.Stderr, string(Scrub(p))) + return len(p), nil +} + +func (lwc *LogWriterCloser) Close() error { + return nil +} + +type LogProvider struct { +} + +func (s *LogProvider) NewFile(p string) io.WriteCloser { + return NewLogWriterCloser() +} + +func (s *LogProvider) Flush() { +} diff --git a/vendor/github.com/vmware/govmomi/vim25/methods/methods.go b/vendor/github.com/vmware/govmomi/vim25/methods/methods.go index c3ad23eefb4..4f1cf8ac0b5 100644 --- a/vendor/github.com/vmware/govmomi/vim25/methods/methods.go +++ b/vendor/github.com/vmware/govmomi/vim25/methods/methods.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2022 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,29 @@ import ( "github.com/vmware/govmomi/vim25/types" ) +type AbandonHciWorkflowBody struct { + Req *types.AbandonHciWorkflow `xml:"urn:vim25 AbandonHciWorkflow,omitempty"` + Res *types.AbandonHciWorkflowResponse `xml:"AbandonHciWorkflowResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AbandonHciWorkflowBody) Fault() *soap.Fault { return b.Fault_ } + +func AbandonHciWorkflow(ctx context.Context, r soap.RoundTripper, req *types.AbandonHciWorkflow) (*types.AbandonHciWorkflowResponse, error) { + var reqBody, resBody AbandonHciWorkflowBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type AbdicateDomOwnershipBody struct { Req *types.AbdicateDomOwnership `xml:"urn:vim25 AbdicateDomOwnership,omitempty"` - Res *types.AbdicateDomOwnershipResponse `xml:"urn:vim25 AbdicateDomOwnershipResponse,omitempty"` + Res *types.AbdicateDomOwnershipResponse `xml:"AbdicateDomOwnershipResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -43,9 +63,29 @@ func AbdicateDomOwnership(ctx context.Context, r soap.RoundTripper, req *types.A return resBody.Res, nil } +type AbortCustomization_TaskBody struct { + Req *types.AbortCustomization_Task `xml:"urn:vim25 AbortCustomization_Task,omitempty"` + Res *types.AbortCustomization_TaskResponse `xml:"AbortCustomization_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *AbortCustomization_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func AbortCustomization_Task(ctx context.Context, r soap.RoundTripper, req *types.AbortCustomization_Task) (*types.AbortCustomization_TaskResponse, error) { + var reqBody, resBody AbortCustomization_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type AcknowledgeAlarmBody struct { Req *types.AcknowledgeAlarm `xml:"urn:vim25 AcknowledgeAlarm,omitempty"` - Res *types.AcknowledgeAlarmResponse `xml:"urn:vim25 AcknowledgeAlarmResponse,omitempty"` + Res *types.AcknowledgeAlarmResponse `xml:"AcknowledgeAlarmResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -65,7 +105,7 @@ func AcknowledgeAlarm(ctx context.Context, r soap.RoundTripper, req *types.Ackno type AcquireCimServicesTicketBody struct { Req *types.AcquireCimServicesTicket `xml:"urn:vim25 AcquireCimServicesTicket,omitempty"` - Res *types.AcquireCimServicesTicketResponse `xml:"urn:vim25 AcquireCimServicesTicketResponse,omitempty"` + Res *types.AcquireCimServicesTicketResponse `xml:"AcquireCimServicesTicketResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -85,7 +125,7 @@ func AcquireCimServicesTicket(ctx context.Context, r soap.RoundTripper, req *typ type AcquireCloneTicketBody struct { Req *types.AcquireCloneTicket `xml:"urn:vim25 AcquireCloneTicket,omitempty"` - Res *types.AcquireCloneTicketResponse `xml:"urn:vim25 AcquireCloneTicketResponse,omitempty"` + Res *types.AcquireCloneTicketResponse `xml:"AcquireCloneTicketResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -105,7 +145,7 @@ func AcquireCloneTicket(ctx context.Context, r soap.RoundTripper, req *types.Acq type AcquireCredentialsInGuestBody struct { Req *types.AcquireCredentialsInGuest `xml:"urn:vim25 AcquireCredentialsInGuest,omitempty"` - Res *types.AcquireCredentialsInGuestResponse `xml:"urn:vim25 AcquireCredentialsInGuestResponse,omitempty"` + Res *types.AcquireCredentialsInGuestResponse `xml:"AcquireCredentialsInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -125,7 +165,7 @@ func AcquireCredentialsInGuest(ctx context.Context, r soap.RoundTripper, req *ty type AcquireGenericServiceTicketBody struct { Req *types.AcquireGenericServiceTicket `xml:"urn:vim25 AcquireGenericServiceTicket,omitempty"` - Res *types.AcquireGenericServiceTicketResponse `xml:"urn:vim25 AcquireGenericServiceTicketResponse,omitempty"` + Res *types.AcquireGenericServiceTicketResponse `xml:"AcquireGenericServiceTicketResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -145,7 +185,7 @@ func AcquireGenericServiceTicket(ctx context.Context, r soap.RoundTripper, req * type AcquireLocalTicketBody struct { Req *types.AcquireLocalTicket `xml:"urn:vim25 AcquireLocalTicket,omitempty"` - Res *types.AcquireLocalTicketResponse `xml:"urn:vim25 AcquireLocalTicketResponse,omitempty"` + Res *types.AcquireLocalTicketResponse `xml:"AcquireLocalTicketResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -165,7 +205,7 @@ func AcquireLocalTicket(ctx context.Context, r soap.RoundTripper, req *types.Acq type AcquireMksTicketBody struct { Req *types.AcquireMksTicket `xml:"urn:vim25 AcquireMksTicket,omitempty"` - Res *types.AcquireMksTicketResponse `xml:"urn:vim25 AcquireMksTicketResponse,omitempty"` + Res *types.AcquireMksTicketResponse `xml:"AcquireMksTicketResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -185,7 +225,7 @@ func AcquireMksTicket(ctx context.Context, r soap.RoundTripper, req *types.Acqui type AcquireTicketBody struct { Req *types.AcquireTicket `xml:"urn:vim25 AcquireTicket,omitempty"` - Res *types.AcquireTicketResponse `xml:"urn:vim25 AcquireTicketResponse,omitempty"` + Res *types.AcquireTicketResponse `xml:"AcquireTicketResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -205,7 +245,7 @@ func AcquireTicket(ctx context.Context, r soap.RoundTripper, req *types.AcquireT type AddAuthorizationRoleBody struct { Req *types.AddAuthorizationRole `xml:"urn:vim25 AddAuthorizationRole,omitempty"` - Res *types.AddAuthorizationRoleResponse `xml:"urn:vim25 AddAuthorizationRoleResponse,omitempty"` + Res *types.AddAuthorizationRoleResponse `xml:"AddAuthorizationRoleResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -225,7 +265,7 @@ func AddAuthorizationRole(ctx context.Context, r soap.RoundTripper, req *types.A type AddCustomFieldDefBody struct { Req *types.AddCustomFieldDef `xml:"urn:vim25 AddCustomFieldDef,omitempty"` - Res *types.AddCustomFieldDefResponse `xml:"urn:vim25 AddCustomFieldDefResponse,omitempty"` + Res *types.AddCustomFieldDefResponse `xml:"AddCustomFieldDefResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -245,7 +285,7 @@ func AddCustomFieldDef(ctx context.Context, r soap.RoundTripper, req *types.AddC type AddDVPortgroup_TaskBody struct { Req *types.AddDVPortgroup_Task `xml:"urn:vim25 AddDVPortgroup_Task,omitempty"` - Res *types.AddDVPortgroup_TaskResponse `xml:"urn:vim25 AddDVPortgroup_TaskResponse,omitempty"` + Res *types.AddDVPortgroup_TaskResponse `xml:"AddDVPortgroup_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -265,7 +305,7 @@ func AddDVPortgroup_Task(ctx context.Context, r soap.RoundTripper, req *types.Ad type AddDisks_TaskBody struct { Req *types.AddDisks_Task `xml:"urn:vim25 AddDisks_Task,omitempty"` - Res *types.AddDisks_TaskResponse `xml:"urn:vim25 AddDisks_TaskResponse,omitempty"` + Res *types.AddDisks_TaskResponse `xml:"AddDisks_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -285,7 +325,7 @@ func AddDisks_Task(ctx context.Context, r soap.RoundTripper, req *types.AddDisks type AddFilterBody struct { Req *types.AddFilter `xml:"urn:vim25 AddFilter,omitempty"` - Res *types.AddFilterResponse `xml:"urn:vim25 AddFilterResponse,omitempty"` + Res *types.AddFilterResponse `xml:"AddFilterResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -305,7 +345,7 @@ func AddFilter(ctx context.Context, r soap.RoundTripper, req *types.AddFilter) ( type AddFilterEntitiesBody struct { Req *types.AddFilterEntities `xml:"urn:vim25 AddFilterEntities,omitempty"` - Res *types.AddFilterEntitiesResponse `xml:"urn:vim25 AddFilterEntitiesResponse,omitempty"` + Res *types.AddFilterEntitiesResponse `xml:"AddFilterEntitiesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -325,7 +365,7 @@ func AddFilterEntities(ctx context.Context, r soap.RoundTripper, req *types.AddF type AddGuestAliasBody struct { Req *types.AddGuestAlias `xml:"urn:vim25 AddGuestAlias,omitempty"` - Res *types.AddGuestAliasResponse `xml:"urn:vim25 AddGuestAliasResponse,omitempty"` + Res *types.AddGuestAliasResponse `xml:"AddGuestAliasResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -345,7 +385,7 @@ func AddGuestAlias(ctx context.Context, r soap.RoundTripper, req *types.AddGuest type AddHost_TaskBody struct { Req *types.AddHost_Task `xml:"urn:vim25 AddHost_Task,omitempty"` - Res *types.AddHost_TaskResponse `xml:"urn:vim25 AddHost_TaskResponse,omitempty"` + Res *types.AddHost_TaskResponse `xml:"AddHost_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -365,7 +405,7 @@ func AddHost_Task(ctx context.Context, r soap.RoundTripper, req *types.AddHost_T type AddInternetScsiSendTargetsBody struct { Req *types.AddInternetScsiSendTargets `xml:"urn:vim25 AddInternetScsiSendTargets,omitempty"` - Res *types.AddInternetScsiSendTargetsResponse `xml:"urn:vim25 AddInternetScsiSendTargetsResponse,omitempty"` + Res *types.AddInternetScsiSendTargetsResponse `xml:"AddInternetScsiSendTargetsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -385,7 +425,7 @@ func AddInternetScsiSendTargets(ctx context.Context, r soap.RoundTripper, req *t type AddInternetScsiStaticTargetsBody struct { Req *types.AddInternetScsiStaticTargets `xml:"urn:vim25 AddInternetScsiStaticTargets,omitempty"` - Res *types.AddInternetScsiStaticTargetsResponse `xml:"urn:vim25 AddInternetScsiStaticTargetsResponse,omitempty"` + Res *types.AddInternetScsiStaticTargetsResponse `xml:"AddInternetScsiStaticTargetsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -405,7 +445,7 @@ func AddInternetScsiStaticTargets(ctx context.Context, r soap.RoundTripper, req type AddKeyBody struct { Req *types.AddKey `xml:"urn:vim25 AddKey,omitempty"` - Res *types.AddKeyResponse `xml:"urn:vim25 AddKeyResponse,omitempty"` + Res *types.AddKeyResponse `xml:"AddKeyResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -425,7 +465,7 @@ func AddKey(ctx context.Context, r soap.RoundTripper, req *types.AddKey) (*types type AddKeysBody struct { Req *types.AddKeys `xml:"urn:vim25 AddKeys,omitempty"` - Res *types.AddKeysResponse `xml:"urn:vim25 AddKeysResponse,omitempty"` + Res *types.AddKeysResponse `xml:"AddKeysResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -445,7 +485,7 @@ func AddKeys(ctx context.Context, r soap.RoundTripper, req *types.AddKeys) (*typ type AddLicenseBody struct { Req *types.AddLicense `xml:"urn:vim25 AddLicense,omitempty"` - Res *types.AddLicenseResponse `xml:"urn:vim25 AddLicenseResponse,omitempty"` + Res *types.AddLicenseResponse `xml:"AddLicenseResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -465,7 +505,7 @@ func AddLicense(ctx context.Context, r soap.RoundTripper, req *types.AddLicense) type AddMonitoredEntitiesBody struct { Req *types.AddMonitoredEntities `xml:"urn:vim25 AddMonitoredEntities,omitempty"` - Res *types.AddMonitoredEntitiesResponse `xml:"urn:vim25 AddMonitoredEntitiesResponse,omitempty"` + Res *types.AddMonitoredEntitiesResponse `xml:"AddMonitoredEntitiesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -485,7 +525,7 @@ func AddMonitoredEntities(ctx context.Context, r soap.RoundTripper, req *types.A type AddNetworkResourcePoolBody struct { Req *types.AddNetworkResourcePool `xml:"urn:vim25 AddNetworkResourcePool,omitempty"` - Res *types.AddNetworkResourcePoolResponse `xml:"urn:vim25 AddNetworkResourcePoolResponse,omitempty"` + Res *types.AddNetworkResourcePoolResponse `xml:"AddNetworkResourcePoolResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -505,7 +545,7 @@ func AddNetworkResourcePool(ctx context.Context, r soap.RoundTripper, req *types type AddPortGroupBody struct { Req *types.AddPortGroup `xml:"urn:vim25 AddPortGroup,omitempty"` - Res *types.AddPortGroupResponse `xml:"urn:vim25 AddPortGroupResponse,omitempty"` + Res *types.AddPortGroupResponse `xml:"AddPortGroupResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -525,7 +565,7 @@ func AddPortGroup(ctx context.Context, r soap.RoundTripper, req *types.AddPortGr type AddServiceConsoleVirtualNicBody struct { Req *types.AddServiceConsoleVirtualNic `xml:"urn:vim25 AddServiceConsoleVirtualNic,omitempty"` - Res *types.AddServiceConsoleVirtualNicResponse `xml:"urn:vim25 AddServiceConsoleVirtualNicResponse,omitempty"` + Res *types.AddServiceConsoleVirtualNicResponse `xml:"AddServiceConsoleVirtualNicResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -545,7 +585,7 @@ func AddServiceConsoleVirtualNic(ctx context.Context, r soap.RoundTripper, req * type AddStandaloneHost_TaskBody struct { Req *types.AddStandaloneHost_Task `xml:"urn:vim25 AddStandaloneHost_Task,omitempty"` - Res *types.AddStandaloneHost_TaskResponse `xml:"urn:vim25 AddStandaloneHost_TaskResponse,omitempty"` + Res *types.AddStandaloneHost_TaskResponse `xml:"AddStandaloneHost_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -565,7 +605,7 @@ func AddStandaloneHost_Task(ctx context.Context, r soap.RoundTripper, req *types type AddVirtualNicBody struct { Req *types.AddVirtualNic `xml:"urn:vim25 AddVirtualNic,omitempty"` - Res *types.AddVirtualNicResponse `xml:"urn:vim25 AddVirtualNicResponse,omitempty"` + Res *types.AddVirtualNicResponse `xml:"AddVirtualNicResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -585,7 +625,7 @@ func AddVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.AddVirtu type AddVirtualSwitchBody struct { Req *types.AddVirtualSwitch `xml:"urn:vim25 AddVirtualSwitch,omitempty"` - Res *types.AddVirtualSwitchResponse `xml:"urn:vim25 AddVirtualSwitchResponse,omitempty"` + Res *types.AddVirtualSwitchResponse `xml:"AddVirtualSwitchResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -605,7 +645,7 @@ func AddVirtualSwitch(ctx context.Context, r soap.RoundTripper, req *types.AddVi type AllocateIpv4AddressBody struct { Req *types.AllocateIpv4Address `xml:"urn:vim25 AllocateIpv4Address,omitempty"` - Res *types.AllocateIpv4AddressResponse `xml:"urn:vim25 AllocateIpv4AddressResponse,omitempty"` + Res *types.AllocateIpv4AddressResponse `xml:"AllocateIpv4AddressResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -625,7 +665,7 @@ func AllocateIpv4Address(ctx context.Context, r soap.RoundTripper, req *types.Al type AllocateIpv6AddressBody struct { Req *types.AllocateIpv6Address `xml:"urn:vim25 AllocateIpv6Address,omitempty"` - Res *types.AllocateIpv6AddressResponse `xml:"urn:vim25 AllocateIpv6AddressResponse,omitempty"` + Res *types.AllocateIpv6AddressResponse `xml:"AllocateIpv6AddressResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -645,7 +685,7 @@ func AllocateIpv6Address(ctx context.Context, r soap.RoundTripper, req *types.Al type AnswerVMBody struct { Req *types.AnswerVM `xml:"urn:vim25 AnswerVM,omitempty"` - Res *types.AnswerVMResponse `xml:"urn:vim25 AnswerVMResponse,omitempty"` + Res *types.AnswerVMResponse `xml:"AnswerVMResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -665,7 +705,7 @@ func AnswerVM(ctx context.Context, r soap.RoundTripper, req *types.AnswerVM) (*t type ApplyEntitiesConfig_TaskBody struct { Req *types.ApplyEntitiesConfig_Task `xml:"urn:vim25 ApplyEntitiesConfig_Task,omitempty"` - Res *types.ApplyEntitiesConfig_TaskResponse `xml:"urn:vim25 ApplyEntitiesConfig_TaskResponse,omitempty"` + Res *types.ApplyEntitiesConfig_TaskResponse `xml:"ApplyEntitiesConfig_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -685,7 +725,7 @@ func ApplyEntitiesConfig_Task(ctx context.Context, r soap.RoundTripper, req *typ type ApplyEvcModeVM_TaskBody struct { Req *types.ApplyEvcModeVM_Task `xml:"urn:vim25 ApplyEvcModeVM_Task,omitempty"` - Res *types.ApplyEvcModeVM_TaskResponse `xml:"urn:vim25 ApplyEvcModeVM_TaskResponse,omitempty"` + Res *types.ApplyEvcModeVM_TaskResponse `xml:"ApplyEvcModeVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -705,7 +745,7 @@ func ApplyEvcModeVM_Task(ctx context.Context, r soap.RoundTripper, req *types.Ap type ApplyHostConfig_TaskBody struct { Req *types.ApplyHostConfig_Task `xml:"urn:vim25 ApplyHostConfig_Task,omitempty"` - Res *types.ApplyHostConfig_TaskResponse `xml:"urn:vim25 ApplyHostConfig_TaskResponse,omitempty"` + Res *types.ApplyHostConfig_TaskResponse `xml:"ApplyHostConfig_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -725,7 +765,7 @@ func ApplyHostConfig_Task(ctx context.Context, r soap.RoundTripper, req *types.A type ApplyRecommendationBody struct { Req *types.ApplyRecommendation `xml:"urn:vim25 ApplyRecommendation,omitempty"` - Res *types.ApplyRecommendationResponse `xml:"urn:vim25 ApplyRecommendationResponse,omitempty"` + Res *types.ApplyRecommendationResponse `xml:"ApplyRecommendationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -745,7 +785,7 @@ func ApplyRecommendation(ctx context.Context, r soap.RoundTripper, req *types.Ap type ApplyStorageDrsRecommendationToPod_TaskBody struct { Req *types.ApplyStorageDrsRecommendationToPod_Task `xml:"urn:vim25 ApplyStorageDrsRecommendationToPod_Task,omitempty"` - Res *types.ApplyStorageDrsRecommendationToPod_TaskResponse `xml:"urn:vim25 ApplyStorageDrsRecommendationToPod_TaskResponse,omitempty"` + Res *types.ApplyStorageDrsRecommendationToPod_TaskResponse `xml:"ApplyStorageDrsRecommendationToPod_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -765,7 +805,7 @@ func ApplyStorageDrsRecommendationToPod_Task(ctx context.Context, r soap.RoundTr type ApplyStorageDrsRecommendation_TaskBody struct { Req *types.ApplyStorageDrsRecommendation_Task `xml:"urn:vim25 ApplyStorageDrsRecommendation_Task,omitempty"` - Res *types.ApplyStorageDrsRecommendation_TaskResponse `xml:"urn:vim25 ApplyStorageDrsRecommendation_TaskResponse,omitempty"` + Res *types.ApplyStorageDrsRecommendation_TaskResponse `xml:"ApplyStorageDrsRecommendation_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -785,7 +825,7 @@ func ApplyStorageDrsRecommendation_Task(ctx context.Context, r soap.RoundTripper type AreAlarmActionsEnabledBody struct { Req *types.AreAlarmActionsEnabled `xml:"urn:vim25 AreAlarmActionsEnabled,omitempty"` - Res *types.AreAlarmActionsEnabledResponse `xml:"urn:vim25 AreAlarmActionsEnabledResponse,omitempty"` + Res *types.AreAlarmActionsEnabledResponse `xml:"AreAlarmActionsEnabledResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -805,7 +845,7 @@ func AreAlarmActionsEnabled(ctx context.Context, r soap.RoundTripper, req *types type AssignUserToGroupBody struct { Req *types.AssignUserToGroup `xml:"urn:vim25 AssignUserToGroup,omitempty"` - Res *types.AssignUserToGroupResponse `xml:"urn:vim25 AssignUserToGroupResponse,omitempty"` + Res *types.AssignUserToGroupResponse `xml:"AssignUserToGroupResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -825,7 +865,7 @@ func AssignUserToGroup(ctx context.Context, r soap.RoundTripper, req *types.Assi type AssociateProfileBody struct { Req *types.AssociateProfile `xml:"urn:vim25 AssociateProfile,omitempty"` - Res *types.AssociateProfileResponse `xml:"urn:vim25 AssociateProfileResponse,omitempty"` + Res *types.AssociateProfileResponse `xml:"AssociateProfileResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -845,7 +885,7 @@ func AssociateProfile(ctx context.Context, r soap.RoundTripper, req *types.Assoc type AttachDisk_TaskBody struct { Req *types.AttachDisk_Task `xml:"urn:vim25 AttachDisk_Task,omitempty"` - Res *types.AttachDisk_TaskResponse `xml:"urn:vim25 AttachDisk_TaskResponse,omitempty"` + Res *types.AttachDisk_TaskResponse `xml:"AttachDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -865,7 +905,7 @@ func AttachDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.Attach type AttachScsiLunBody struct { Req *types.AttachScsiLun `xml:"urn:vim25 AttachScsiLun,omitempty"` - Res *types.AttachScsiLunResponse `xml:"urn:vim25 AttachScsiLunResponse,omitempty"` + Res *types.AttachScsiLunResponse `xml:"AttachScsiLunResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -885,7 +925,7 @@ func AttachScsiLun(ctx context.Context, r soap.RoundTripper, req *types.AttachSc type AttachScsiLunEx_TaskBody struct { Req *types.AttachScsiLunEx_Task `xml:"urn:vim25 AttachScsiLunEx_Task,omitempty"` - Res *types.AttachScsiLunEx_TaskResponse `xml:"urn:vim25 AttachScsiLunEx_TaskResponse,omitempty"` + Res *types.AttachScsiLunEx_TaskResponse `xml:"AttachScsiLunEx_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -905,7 +945,7 @@ func AttachScsiLunEx_Task(ctx context.Context, r soap.RoundTripper, req *types.A type AttachTagToVStorageObjectBody struct { Req *types.AttachTagToVStorageObject `xml:"urn:vim25 AttachTagToVStorageObject,omitempty"` - Res *types.AttachTagToVStorageObjectResponse `xml:"urn:vim25 AttachTagToVStorageObjectResponse,omitempty"` + Res *types.AttachTagToVStorageObjectResponse `xml:"AttachTagToVStorageObjectResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -925,7 +965,7 @@ func AttachTagToVStorageObject(ctx context.Context, r soap.RoundTripper, req *ty type AttachVmfsExtentBody struct { Req *types.AttachVmfsExtent `xml:"urn:vim25 AttachVmfsExtent,omitempty"` - Res *types.AttachVmfsExtentResponse `xml:"urn:vim25 AttachVmfsExtentResponse,omitempty"` + Res *types.AttachVmfsExtentResponse `xml:"AttachVmfsExtentResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -945,7 +985,7 @@ func AttachVmfsExtent(ctx context.Context, r soap.RoundTripper, req *types.Attac type AutoStartPowerOffBody struct { Req *types.AutoStartPowerOff `xml:"urn:vim25 AutoStartPowerOff,omitempty"` - Res *types.AutoStartPowerOffResponse `xml:"urn:vim25 AutoStartPowerOffResponse,omitempty"` + Res *types.AutoStartPowerOffResponse `xml:"AutoStartPowerOffResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -965,7 +1005,7 @@ func AutoStartPowerOff(ctx context.Context, r soap.RoundTripper, req *types.Auto type AutoStartPowerOnBody struct { Req *types.AutoStartPowerOn `xml:"urn:vim25 AutoStartPowerOn,omitempty"` - Res *types.AutoStartPowerOnResponse `xml:"urn:vim25 AutoStartPowerOnResponse,omitempty"` + Res *types.AutoStartPowerOnResponse `xml:"AutoStartPowerOnResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -985,7 +1025,7 @@ func AutoStartPowerOn(ctx context.Context, r soap.RoundTripper, req *types.AutoS type BackupFirmwareConfigurationBody struct { Req *types.BackupFirmwareConfiguration `xml:"urn:vim25 BackupFirmwareConfiguration,omitempty"` - Res *types.BackupFirmwareConfigurationResponse `xml:"urn:vim25 BackupFirmwareConfigurationResponse,omitempty"` + Res *types.BackupFirmwareConfigurationResponse `xml:"BackupFirmwareConfigurationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1003,9 +1043,69 @@ func BackupFirmwareConfiguration(ctx context.Context, r soap.RoundTripper, req * return resBody.Res, nil } +type BatchAddHostsToCluster_TaskBody struct { + Req *types.BatchAddHostsToCluster_Task `xml:"urn:vim25 BatchAddHostsToCluster_Task,omitempty"` + Res *types.BatchAddHostsToCluster_TaskResponse `xml:"BatchAddHostsToCluster_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *BatchAddHostsToCluster_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func BatchAddHostsToCluster_Task(ctx context.Context, r soap.RoundTripper, req *types.BatchAddHostsToCluster_Task) (*types.BatchAddHostsToCluster_TaskResponse, error) { + var reqBody, resBody BatchAddHostsToCluster_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type BatchAddStandaloneHosts_TaskBody struct { + Req *types.BatchAddStandaloneHosts_Task `xml:"urn:vim25 BatchAddStandaloneHosts_Task,omitempty"` + Res *types.BatchAddStandaloneHosts_TaskResponse `xml:"BatchAddStandaloneHosts_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *BatchAddStandaloneHosts_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func BatchAddStandaloneHosts_Task(ctx context.Context, r soap.RoundTripper, req *types.BatchAddStandaloneHosts_Task) (*types.BatchAddStandaloneHosts_TaskResponse, error) { + var reqBody, resBody BatchAddStandaloneHosts_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type BatchQueryConnectInfoBody struct { + Req *types.BatchQueryConnectInfo `xml:"urn:vim25 BatchQueryConnectInfo,omitempty"` + Res *types.BatchQueryConnectInfoResponse `xml:"BatchQueryConnectInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *BatchQueryConnectInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func BatchQueryConnectInfo(ctx context.Context, r soap.RoundTripper, req *types.BatchQueryConnectInfo) (*types.BatchQueryConnectInfoResponse, error) { + var reqBody, resBody BatchQueryConnectInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type BindVnicBody struct { Req *types.BindVnic `xml:"urn:vim25 BindVnic,omitempty"` - Res *types.BindVnicResponse `xml:"urn:vim25 BindVnicResponse,omitempty"` + Res *types.BindVnicResponse `xml:"BindVnicResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1025,7 +1125,7 @@ func BindVnic(ctx context.Context, r soap.RoundTripper, req *types.BindVnic) (*t type BrowseDiagnosticLogBody struct { Req *types.BrowseDiagnosticLog `xml:"urn:vim25 BrowseDiagnosticLog,omitempty"` - Res *types.BrowseDiagnosticLogResponse `xml:"urn:vim25 BrowseDiagnosticLogResponse,omitempty"` + Res *types.BrowseDiagnosticLogResponse `xml:"BrowseDiagnosticLogResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1045,7 +1145,7 @@ func BrowseDiagnosticLog(ctx context.Context, r soap.RoundTripper, req *types.Br type CanProvisionObjectsBody struct { Req *types.CanProvisionObjects `xml:"urn:vim25 CanProvisionObjects,omitempty"` - Res *types.CanProvisionObjectsResponse `xml:"urn:vim25 CanProvisionObjectsResponse,omitempty"` + Res *types.CanProvisionObjectsResponse `xml:"CanProvisionObjectsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1065,7 +1165,7 @@ func CanProvisionObjects(ctx context.Context, r soap.RoundTripper, req *types.Ca type CancelRecommendationBody struct { Req *types.CancelRecommendation `xml:"urn:vim25 CancelRecommendation,omitempty"` - Res *types.CancelRecommendationResponse `xml:"urn:vim25 CancelRecommendationResponse,omitempty"` + Res *types.CancelRecommendationResponse `xml:"CancelRecommendationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1085,7 +1185,7 @@ func CancelRecommendation(ctx context.Context, r soap.RoundTripper, req *types.C type CancelRetrievePropertiesExBody struct { Req *types.CancelRetrievePropertiesEx `xml:"urn:vim25 CancelRetrievePropertiesEx,omitempty"` - Res *types.CancelRetrievePropertiesExResponse `xml:"urn:vim25 CancelRetrievePropertiesExResponse,omitempty"` + Res *types.CancelRetrievePropertiesExResponse `xml:"CancelRetrievePropertiesExResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1105,7 +1205,7 @@ func CancelRetrievePropertiesEx(ctx context.Context, r soap.RoundTripper, req *t type CancelStorageDrsRecommendationBody struct { Req *types.CancelStorageDrsRecommendation `xml:"urn:vim25 CancelStorageDrsRecommendation,omitempty"` - Res *types.CancelStorageDrsRecommendationResponse `xml:"urn:vim25 CancelStorageDrsRecommendationResponse,omitempty"` + Res *types.CancelStorageDrsRecommendationResponse `xml:"CancelStorageDrsRecommendationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1125,7 +1225,7 @@ func CancelStorageDrsRecommendation(ctx context.Context, r soap.RoundTripper, re type CancelTaskBody struct { Req *types.CancelTask `xml:"urn:vim25 CancelTask,omitempty"` - Res *types.CancelTaskResponse `xml:"urn:vim25 CancelTaskResponse,omitempty"` + Res *types.CancelTaskResponse `xml:"CancelTaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1145,7 +1245,7 @@ func CancelTask(ctx context.Context, r soap.RoundTripper, req *types.CancelTask) type CancelWaitForUpdatesBody struct { Req *types.CancelWaitForUpdates `xml:"urn:vim25 CancelWaitForUpdates,omitempty"` - Res *types.CancelWaitForUpdatesResponse `xml:"urn:vim25 CancelWaitForUpdatesResponse,omitempty"` + Res *types.CancelWaitForUpdatesResponse `xml:"CancelWaitForUpdatesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1165,7 +1265,7 @@ func CancelWaitForUpdates(ctx context.Context, r soap.RoundTripper, req *types.C type CertMgrRefreshCACertificatesAndCRLs_TaskBody struct { Req *types.CertMgrRefreshCACertificatesAndCRLs_Task `xml:"urn:vim25 CertMgrRefreshCACertificatesAndCRLs_Task,omitempty"` - Res *types.CertMgrRefreshCACertificatesAndCRLs_TaskResponse `xml:"urn:vim25 CertMgrRefreshCACertificatesAndCRLs_TaskResponse,omitempty"` + Res *types.CertMgrRefreshCACertificatesAndCRLs_TaskResponse `xml:"CertMgrRefreshCACertificatesAndCRLs_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1185,7 +1285,7 @@ func CertMgrRefreshCACertificatesAndCRLs_Task(ctx context.Context, r soap.RoundT type CertMgrRefreshCertificates_TaskBody struct { Req *types.CertMgrRefreshCertificates_Task `xml:"urn:vim25 CertMgrRefreshCertificates_Task,omitempty"` - Res *types.CertMgrRefreshCertificates_TaskResponse `xml:"urn:vim25 CertMgrRefreshCertificates_TaskResponse,omitempty"` + Res *types.CertMgrRefreshCertificates_TaskResponse `xml:"CertMgrRefreshCertificates_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1205,7 +1305,7 @@ func CertMgrRefreshCertificates_Task(ctx context.Context, r soap.RoundTripper, r type CertMgrRevokeCertificates_TaskBody struct { Req *types.CertMgrRevokeCertificates_Task `xml:"urn:vim25 CertMgrRevokeCertificates_Task,omitempty"` - Res *types.CertMgrRevokeCertificates_TaskResponse `xml:"urn:vim25 CertMgrRevokeCertificates_TaskResponse,omitempty"` + Res *types.CertMgrRevokeCertificates_TaskResponse `xml:"CertMgrRevokeCertificates_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1225,7 +1325,7 @@ func CertMgrRevokeCertificates_Task(ctx context.Context, r soap.RoundTripper, re type ChangeAccessModeBody struct { Req *types.ChangeAccessMode `xml:"urn:vim25 ChangeAccessMode,omitempty"` - Res *types.ChangeAccessModeResponse `xml:"urn:vim25 ChangeAccessModeResponse,omitempty"` + Res *types.ChangeAccessModeResponse `xml:"ChangeAccessModeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1245,7 +1345,7 @@ func ChangeAccessMode(ctx context.Context, r soap.RoundTripper, req *types.Chang type ChangeFileAttributesInGuestBody struct { Req *types.ChangeFileAttributesInGuest `xml:"urn:vim25 ChangeFileAttributesInGuest,omitempty"` - Res *types.ChangeFileAttributesInGuestResponse `xml:"urn:vim25 ChangeFileAttributesInGuestResponse,omitempty"` + Res *types.ChangeFileAttributesInGuestResponse `xml:"ChangeFileAttributesInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1265,7 +1365,7 @@ func ChangeFileAttributesInGuest(ctx context.Context, r soap.RoundTripper, req * type ChangeKey_TaskBody struct { Req *types.ChangeKey_Task `xml:"urn:vim25 ChangeKey_Task,omitempty"` - Res *types.ChangeKey_TaskResponse `xml:"urn:vim25 ChangeKey_TaskResponse,omitempty"` + Res *types.ChangeKey_TaskResponse `xml:"ChangeKey_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1285,7 +1385,7 @@ func ChangeKey_Task(ctx context.Context, r soap.RoundTripper, req *types.ChangeK type ChangeLockdownModeBody struct { Req *types.ChangeLockdownMode `xml:"urn:vim25 ChangeLockdownMode,omitempty"` - Res *types.ChangeLockdownModeResponse `xml:"urn:vim25 ChangeLockdownModeResponse,omitempty"` + Res *types.ChangeLockdownModeResponse `xml:"ChangeLockdownModeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1305,7 +1405,7 @@ func ChangeLockdownMode(ctx context.Context, r soap.RoundTripper, req *types.Cha type ChangeNFSUserPasswordBody struct { Req *types.ChangeNFSUserPassword `xml:"urn:vim25 ChangeNFSUserPassword,omitempty"` - Res *types.ChangeNFSUserPasswordResponse `xml:"urn:vim25 ChangeNFSUserPasswordResponse,omitempty"` + Res *types.ChangeNFSUserPasswordResponse `xml:"ChangeNFSUserPasswordResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1325,7 +1425,7 @@ func ChangeNFSUserPassword(ctx context.Context, r soap.RoundTripper, req *types. type ChangeOwnerBody struct { Req *types.ChangeOwner `xml:"urn:vim25 ChangeOwner,omitempty"` - Res *types.ChangeOwnerResponse `xml:"urn:vim25 ChangeOwnerResponse,omitempty"` + Res *types.ChangeOwnerResponse `xml:"ChangeOwnerResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1343,9 +1443,29 @@ func ChangeOwner(ctx context.Context, r soap.RoundTripper, req *types.ChangeOwne return resBody.Res, nil } +type ChangePasswordBody struct { + Req *types.ChangePassword `xml:"urn:vim25 ChangePassword,omitempty"` + Res *types.ChangePasswordResponse `xml:"ChangePasswordResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ChangePasswordBody) Fault() *soap.Fault { return b.Fault_ } + +func ChangePassword(ctx context.Context, r soap.RoundTripper, req *types.ChangePassword) (*types.ChangePasswordResponse, error) { + var reqBody, resBody ChangePasswordBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type CheckAddHostEvc_TaskBody struct { Req *types.CheckAddHostEvc_Task `xml:"urn:vim25 CheckAddHostEvc_Task,omitempty"` - Res *types.CheckAddHostEvc_TaskResponse `xml:"urn:vim25 CheckAddHostEvc_TaskResponse,omitempty"` + Res *types.CheckAddHostEvc_TaskResponse `xml:"CheckAddHostEvc_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1365,7 +1485,7 @@ func CheckAddHostEvc_Task(ctx context.Context, r soap.RoundTripper, req *types.C type CheckAnswerFileStatus_TaskBody struct { Req *types.CheckAnswerFileStatus_Task `xml:"urn:vim25 CheckAnswerFileStatus_Task,omitempty"` - Res *types.CheckAnswerFileStatus_TaskResponse `xml:"urn:vim25 CheckAnswerFileStatus_TaskResponse,omitempty"` + Res *types.CheckAnswerFileStatus_TaskResponse `xml:"CheckAnswerFileStatus_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1385,7 +1505,7 @@ func CheckAnswerFileStatus_Task(ctx context.Context, r soap.RoundTripper, req *t type CheckClone_TaskBody struct { Req *types.CheckClone_Task `xml:"urn:vim25 CheckClone_Task,omitempty"` - Res *types.CheckClone_TaskResponse `xml:"urn:vim25 CheckClone_TaskResponse,omitempty"` + Res *types.CheckClone_TaskResponse `xml:"CheckClone_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1405,7 +1525,7 @@ func CheckClone_Task(ctx context.Context, r soap.RoundTripper, req *types.CheckC type CheckCompatibility_TaskBody struct { Req *types.CheckCompatibility_Task `xml:"urn:vim25 CheckCompatibility_Task,omitempty"` - Res *types.CheckCompatibility_TaskResponse `xml:"urn:vim25 CheckCompatibility_TaskResponse,omitempty"` + Res *types.CheckCompatibility_TaskResponse `xml:"CheckCompatibility_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1425,7 +1545,7 @@ func CheckCompatibility_Task(ctx context.Context, r soap.RoundTripper, req *type type CheckCompliance_TaskBody struct { Req *types.CheckCompliance_Task `xml:"urn:vim25 CheckCompliance_Task,omitempty"` - Res *types.CheckCompliance_TaskResponse `xml:"urn:vim25 CheckCompliance_TaskResponse,omitempty"` + Res *types.CheckCompliance_TaskResponse `xml:"CheckCompliance_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1445,7 +1565,7 @@ func CheckCompliance_Task(ctx context.Context, r soap.RoundTripper, req *types.C type CheckConfigureEvcMode_TaskBody struct { Req *types.CheckConfigureEvcMode_Task `xml:"urn:vim25 CheckConfigureEvcMode_Task,omitempty"` - Res *types.CheckConfigureEvcMode_TaskResponse `xml:"urn:vim25 CheckConfigureEvcMode_TaskResponse,omitempty"` + Res *types.CheckConfigureEvcMode_TaskResponse `xml:"CheckConfigureEvcMode_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1465,7 +1585,7 @@ func CheckConfigureEvcMode_Task(ctx context.Context, r soap.RoundTripper, req *t type CheckCustomizationResourcesBody struct { Req *types.CheckCustomizationResources `xml:"urn:vim25 CheckCustomizationResources,omitempty"` - Res *types.CheckCustomizationResourcesResponse `xml:"urn:vim25 CheckCustomizationResourcesResponse,omitempty"` + Res *types.CheckCustomizationResourcesResponse `xml:"CheckCustomizationResourcesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1485,7 +1605,7 @@ func CheckCustomizationResources(ctx context.Context, r soap.RoundTripper, req * type CheckCustomizationSpecBody struct { Req *types.CheckCustomizationSpec `xml:"urn:vim25 CheckCustomizationSpec,omitempty"` - Res *types.CheckCustomizationSpecResponse `xml:"urn:vim25 CheckCustomizationSpecResponse,omitempty"` + Res *types.CheckCustomizationSpecResponse `xml:"CheckCustomizationSpecResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1505,7 +1625,7 @@ func CheckCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types type CheckForUpdatesBody struct { Req *types.CheckForUpdates `xml:"urn:vim25 CheckForUpdates,omitempty"` - Res *types.CheckForUpdatesResponse `xml:"urn:vim25 CheckForUpdatesResponse,omitempty"` + Res *types.CheckForUpdatesResponse `xml:"CheckForUpdatesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1525,7 +1645,7 @@ func CheckForUpdates(ctx context.Context, r soap.RoundTripper, req *types.CheckF type CheckHostPatch_TaskBody struct { Req *types.CheckHostPatch_Task `xml:"urn:vim25 CheckHostPatch_Task,omitempty"` - Res *types.CheckHostPatch_TaskResponse `xml:"urn:vim25 CheckHostPatch_TaskResponse,omitempty"` + Res *types.CheckHostPatch_TaskResponse `xml:"CheckHostPatch_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1545,7 +1665,7 @@ func CheckHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.Ch type CheckInstantClone_TaskBody struct { Req *types.CheckInstantClone_Task `xml:"urn:vim25 CheckInstantClone_Task,omitempty"` - Res *types.CheckInstantClone_TaskResponse `xml:"urn:vim25 CheckInstantClone_TaskResponse,omitempty"` + Res *types.CheckInstantClone_TaskResponse `xml:"CheckInstantClone_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1565,7 +1685,7 @@ func CheckInstantClone_Task(ctx context.Context, r soap.RoundTripper, req *types type CheckLicenseFeatureBody struct { Req *types.CheckLicenseFeature `xml:"urn:vim25 CheckLicenseFeature,omitempty"` - Res *types.CheckLicenseFeatureResponse `xml:"urn:vim25 CheckLicenseFeatureResponse,omitempty"` + Res *types.CheckLicenseFeatureResponse `xml:"CheckLicenseFeatureResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1585,7 +1705,7 @@ func CheckLicenseFeature(ctx context.Context, r soap.RoundTripper, req *types.Ch type CheckMigrate_TaskBody struct { Req *types.CheckMigrate_Task `xml:"urn:vim25 CheckMigrate_Task,omitempty"` - Res *types.CheckMigrate_TaskResponse `xml:"urn:vim25 CheckMigrate_TaskResponse,omitempty"` + Res *types.CheckMigrate_TaskResponse `xml:"CheckMigrate_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1605,7 +1725,7 @@ func CheckMigrate_Task(ctx context.Context, r soap.RoundTripper, req *types.Chec type CheckPowerOn_TaskBody struct { Req *types.CheckPowerOn_Task `xml:"urn:vim25 CheckPowerOn_Task,omitempty"` - Res *types.CheckPowerOn_TaskResponse `xml:"urn:vim25 CheckPowerOn_TaskResponse,omitempty"` + Res *types.CheckPowerOn_TaskResponse `xml:"CheckPowerOn_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1625,7 +1745,7 @@ func CheckPowerOn_Task(ctx context.Context, r soap.RoundTripper, req *types.Chec type CheckProfileCompliance_TaskBody struct { Req *types.CheckProfileCompliance_Task `xml:"urn:vim25 CheckProfileCompliance_Task,omitempty"` - Res *types.CheckProfileCompliance_TaskResponse `xml:"urn:vim25 CheckProfileCompliance_TaskResponse,omitempty"` + Res *types.CheckProfileCompliance_TaskResponse `xml:"CheckProfileCompliance_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1645,7 +1765,7 @@ func CheckProfileCompliance_Task(ctx context.Context, r soap.RoundTripper, req * type CheckRelocate_TaskBody struct { Req *types.CheckRelocate_Task `xml:"urn:vim25 CheckRelocate_Task,omitempty"` - Res *types.CheckRelocate_TaskResponse `xml:"urn:vim25 CheckRelocate_TaskResponse,omitempty"` + Res *types.CheckRelocate_TaskResponse `xml:"CheckRelocate_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1665,7 +1785,7 @@ func CheckRelocate_Task(ctx context.Context, r soap.RoundTripper, req *types.Che type CheckVmConfig_TaskBody struct { Req *types.CheckVmConfig_Task `xml:"urn:vim25 CheckVmConfig_Task,omitempty"` - Res *types.CheckVmConfig_TaskResponse `xml:"urn:vim25 CheckVmConfig_TaskResponse,omitempty"` + Res *types.CheckVmConfig_TaskResponse `xml:"CheckVmConfig_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1685,7 +1805,7 @@ func CheckVmConfig_Task(ctx context.Context, r soap.RoundTripper, req *types.Che type ClearComplianceStatusBody struct { Req *types.ClearComplianceStatus `xml:"urn:vim25 ClearComplianceStatus,omitempty"` - Res *types.ClearComplianceStatusResponse `xml:"urn:vim25 ClearComplianceStatusResponse,omitempty"` + Res *types.ClearComplianceStatusResponse `xml:"ClearComplianceStatusResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1705,7 +1825,7 @@ func ClearComplianceStatus(ctx context.Context, r soap.RoundTripper, req *types. type ClearNFSUserBody struct { Req *types.ClearNFSUser `xml:"urn:vim25 ClearNFSUser,omitempty"` - Res *types.ClearNFSUserResponse `xml:"urn:vim25 ClearNFSUserResponse,omitempty"` + Res *types.ClearNFSUserResponse `xml:"ClearNFSUserResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1725,7 +1845,7 @@ func ClearNFSUser(ctx context.Context, r soap.RoundTripper, req *types.ClearNFSU type ClearSystemEventLogBody struct { Req *types.ClearSystemEventLog `xml:"urn:vim25 ClearSystemEventLog,omitempty"` - Res *types.ClearSystemEventLogResponse `xml:"urn:vim25 ClearSystemEventLogResponse,omitempty"` + Res *types.ClearSystemEventLogResponse `xml:"ClearSystemEventLogResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1745,7 +1865,7 @@ func ClearSystemEventLog(ctx context.Context, r soap.RoundTripper, req *types.Cl type ClearTriggeredAlarmsBody struct { Req *types.ClearTriggeredAlarms `xml:"urn:vim25 ClearTriggeredAlarms,omitempty"` - Res *types.ClearTriggeredAlarmsResponse `xml:"urn:vim25 ClearTriggeredAlarmsResponse,omitempty"` + Res *types.ClearTriggeredAlarmsResponse `xml:"ClearTriggeredAlarmsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1765,7 +1885,7 @@ func ClearTriggeredAlarms(ctx context.Context, r soap.RoundTripper, req *types.C type ClearVStorageObjectControlFlagsBody struct { Req *types.ClearVStorageObjectControlFlags `xml:"urn:vim25 ClearVStorageObjectControlFlags,omitempty"` - Res *types.ClearVStorageObjectControlFlagsResponse `xml:"urn:vim25 ClearVStorageObjectControlFlagsResponse,omitempty"` + Res *types.ClearVStorageObjectControlFlagsResponse `xml:"ClearVStorageObjectControlFlagsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1785,7 +1905,7 @@ func ClearVStorageObjectControlFlags(ctx context.Context, r soap.RoundTripper, r type CloneSessionBody struct { Req *types.CloneSession `xml:"urn:vim25 CloneSession,omitempty"` - Res *types.CloneSessionResponse `xml:"urn:vim25 CloneSessionResponse,omitempty"` + Res *types.CloneSessionResponse `xml:"CloneSessionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1805,7 +1925,7 @@ func CloneSession(ctx context.Context, r soap.RoundTripper, req *types.CloneSess type CloneVApp_TaskBody struct { Req *types.CloneVApp_Task `xml:"urn:vim25 CloneVApp_Task,omitempty"` - Res *types.CloneVApp_TaskResponse `xml:"urn:vim25 CloneVApp_TaskResponse,omitempty"` + Res *types.CloneVApp_TaskResponse `xml:"CloneVApp_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1825,7 +1945,7 @@ func CloneVApp_Task(ctx context.Context, r soap.RoundTripper, req *types.CloneVA type CloneVM_TaskBody struct { Req *types.CloneVM_Task `xml:"urn:vim25 CloneVM_Task,omitempty"` - Res *types.CloneVM_TaskResponse `xml:"urn:vim25 CloneVM_TaskResponse,omitempty"` + Res *types.CloneVM_TaskResponse `xml:"CloneVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1845,7 +1965,7 @@ func CloneVM_Task(ctx context.Context, r soap.RoundTripper, req *types.CloneVM_T type CloneVStorageObject_TaskBody struct { Req *types.CloneVStorageObject_Task `xml:"urn:vim25 CloneVStorageObject_Task,omitempty"` - Res *types.CloneVStorageObject_TaskResponse `xml:"urn:vim25 CloneVStorageObject_TaskResponse,omitempty"` + Res *types.CloneVStorageObject_TaskResponse `xml:"CloneVStorageObject_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1865,7 +1985,7 @@ func CloneVStorageObject_Task(ctx context.Context, r soap.RoundTripper, req *typ type CloseInventoryViewFolderBody struct { Req *types.CloseInventoryViewFolder `xml:"urn:vim25 CloseInventoryViewFolder,omitempty"` - Res *types.CloseInventoryViewFolderResponse `xml:"urn:vim25 CloseInventoryViewFolderResponse,omitempty"` + Res *types.CloseInventoryViewFolderResponse `xml:"CloseInventoryViewFolderResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1885,7 +2005,7 @@ func CloseInventoryViewFolder(ctx context.Context, r soap.RoundTripper, req *typ type ClusterEnterMaintenanceModeBody struct { Req *types.ClusterEnterMaintenanceMode `xml:"urn:vim25 ClusterEnterMaintenanceMode,omitempty"` - Res *types.ClusterEnterMaintenanceModeResponse `xml:"urn:vim25 ClusterEnterMaintenanceModeResponse,omitempty"` + Res *types.ClusterEnterMaintenanceModeResponse `xml:"ClusterEnterMaintenanceModeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1905,7 +2025,7 @@ func ClusterEnterMaintenanceMode(ctx context.Context, r soap.RoundTripper, req * type CompositeHostProfile_TaskBody struct { Req *types.CompositeHostProfile_Task `xml:"urn:vim25 CompositeHostProfile_Task,omitempty"` - Res *types.CompositeHostProfile_TaskResponse `xml:"urn:vim25 CompositeHostProfile_TaskResponse,omitempty"` + Res *types.CompositeHostProfile_TaskResponse `xml:"CompositeHostProfile_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1925,7 +2045,7 @@ func CompositeHostProfile_Task(ctx context.Context, r soap.RoundTripper, req *ty type ComputeDiskPartitionInfoBody struct { Req *types.ComputeDiskPartitionInfo `xml:"urn:vim25 ComputeDiskPartitionInfo,omitempty"` - Res *types.ComputeDiskPartitionInfoResponse `xml:"urn:vim25 ComputeDiskPartitionInfoResponse,omitempty"` + Res *types.ComputeDiskPartitionInfoResponse `xml:"ComputeDiskPartitionInfoResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1945,7 +2065,7 @@ func ComputeDiskPartitionInfo(ctx context.Context, r soap.RoundTripper, req *typ type ComputeDiskPartitionInfoForResizeBody struct { Req *types.ComputeDiskPartitionInfoForResize `xml:"urn:vim25 ComputeDiskPartitionInfoForResize,omitempty"` - Res *types.ComputeDiskPartitionInfoForResizeResponse `xml:"urn:vim25 ComputeDiskPartitionInfoForResizeResponse,omitempty"` + Res *types.ComputeDiskPartitionInfoForResizeResponse `xml:"ComputeDiskPartitionInfoForResizeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1965,7 +2085,7 @@ func ComputeDiskPartitionInfoForResize(ctx context.Context, r soap.RoundTripper, type ConfigureCryptoKeyBody struct { Req *types.ConfigureCryptoKey `xml:"urn:vim25 ConfigureCryptoKey,omitempty"` - Res *types.ConfigureCryptoKeyResponse `xml:"urn:vim25 ConfigureCryptoKeyResponse,omitempty"` + Res *types.ConfigureCryptoKeyResponse `xml:"ConfigureCryptoKeyResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -1985,7 +2105,7 @@ func ConfigureCryptoKey(ctx context.Context, r soap.RoundTripper, req *types.Con type ConfigureDatastoreIORM_TaskBody struct { Req *types.ConfigureDatastoreIORM_Task `xml:"urn:vim25 ConfigureDatastoreIORM_Task,omitempty"` - Res *types.ConfigureDatastoreIORM_TaskResponse `xml:"urn:vim25 ConfigureDatastoreIORM_TaskResponse,omitempty"` + Res *types.ConfigureDatastoreIORM_TaskResponse `xml:"ConfigureDatastoreIORM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2005,7 +2125,7 @@ func ConfigureDatastoreIORM_Task(ctx context.Context, r soap.RoundTripper, req * type ConfigureDatastorePrincipalBody struct { Req *types.ConfigureDatastorePrincipal `xml:"urn:vim25 ConfigureDatastorePrincipal,omitempty"` - Res *types.ConfigureDatastorePrincipalResponse `xml:"urn:vim25 ConfigureDatastorePrincipalResponse,omitempty"` + Res *types.ConfigureDatastorePrincipalResponse `xml:"ConfigureDatastorePrincipalResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2025,7 +2145,7 @@ func ConfigureDatastorePrincipal(ctx context.Context, r soap.RoundTripper, req * type ConfigureEvcMode_TaskBody struct { Req *types.ConfigureEvcMode_Task `xml:"urn:vim25 ConfigureEvcMode_Task,omitempty"` - Res *types.ConfigureEvcMode_TaskResponse `xml:"urn:vim25 ConfigureEvcMode_TaskResponse,omitempty"` + Res *types.ConfigureEvcMode_TaskResponse `xml:"ConfigureEvcMode_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2043,9 +2163,29 @@ func ConfigureEvcMode_Task(ctx context.Context, r soap.RoundTripper, req *types. return resBody.Res, nil } +type ConfigureHCI_TaskBody struct { + Req *types.ConfigureHCI_Task `xml:"urn:vim25 ConfigureHCI_Task,omitempty"` + Res *types.ConfigureHCI_TaskResponse `xml:"ConfigureHCI_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ConfigureHCI_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ConfigureHCI_Task(ctx context.Context, r soap.RoundTripper, req *types.ConfigureHCI_Task) (*types.ConfigureHCI_TaskResponse, error) { + var reqBody, resBody ConfigureHCI_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type ConfigureHostCache_TaskBody struct { Req *types.ConfigureHostCache_Task `xml:"urn:vim25 ConfigureHostCache_Task,omitempty"` - Res *types.ConfigureHostCache_TaskResponse `xml:"urn:vim25 ConfigureHostCache_TaskResponse,omitempty"` + Res *types.ConfigureHostCache_TaskResponse `xml:"ConfigureHostCache_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2065,7 +2205,7 @@ func ConfigureHostCache_Task(ctx context.Context, r soap.RoundTripper, req *type type ConfigureLicenseSourceBody struct { Req *types.ConfigureLicenseSource `xml:"urn:vim25 ConfigureLicenseSource,omitempty"` - Res *types.ConfigureLicenseSourceResponse `xml:"urn:vim25 ConfigureLicenseSourceResponse,omitempty"` + Res *types.ConfigureLicenseSourceResponse `xml:"ConfigureLicenseSourceResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2085,7 +2225,7 @@ func ConfigureLicenseSource(ctx context.Context, r soap.RoundTripper, req *types type ConfigurePowerPolicyBody struct { Req *types.ConfigurePowerPolicy `xml:"urn:vim25 ConfigurePowerPolicy,omitempty"` - Res *types.ConfigurePowerPolicyResponse `xml:"urn:vim25 ConfigurePowerPolicyResponse,omitempty"` + Res *types.ConfigurePowerPolicyResponse `xml:"ConfigurePowerPolicyResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2105,7 +2245,7 @@ func ConfigurePowerPolicy(ctx context.Context, r soap.RoundTripper, req *types.C type ConfigureStorageDrsForPod_TaskBody struct { Req *types.ConfigureStorageDrsForPod_Task `xml:"urn:vim25 ConfigureStorageDrsForPod_Task,omitempty"` - Res *types.ConfigureStorageDrsForPod_TaskResponse `xml:"urn:vim25 ConfigureStorageDrsForPod_TaskResponse,omitempty"` + Res *types.ConfigureStorageDrsForPod_TaskResponse `xml:"ConfigureStorageDrsForPod_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2125,7 +2265,7 @@ func ConfigureStorageDrsForPod_Task(ctx context.Context, r soap.RoundTripper, re type ConfigureVFlashResourceEx_TaskBody struct { Req *types.ConfigureVFlashResourceEx_Task `xml:"urn:vim25 ConfigureVFlashResourceEx_Task,omitempty"` - Res *types.ConfigureVFlashResourceEx_TaskResponse `xml:"urn:vim25 ConfigureVFlashResourceEx_TaskResponse,omitempty"` + Res *types.ConfigureVFlashResourceEx_TaskResponse `xml:"ConfigureVFlashResourceEx_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2143,9 +2283,49 @@ func ConfigureVFlashResourceEx_Task(ctx context.Context, r soap.RoundTripper, re return resBody.Res, nil } +type ConnectNvmeControllerBody struct { + Req *types.ConnectNvmeController `xml:"urn:vim25 ConnectNvmeController,omitempty"` + Res *types.ConnectNvmeControllerResponse `xml:"ConnectNvmeControllerResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ConnectNvmeControllerBody) Fault() *soap.Fault { return b.Fault_ } + +func ConnectNvmeController(ctx context.Context, r soap.RoundTripper, req *types.ConnectNvmeController) (*types.ConnectNvmeControllerResponse, error) { + var reqBody, resBody ConnectNvmeControllerBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type ConnectNvmeControllerEx_TaskBody struct { + Req *types.ConnectNvmeControllerEx_Task `xml:"urn:vim25 ConnectNvmeControllerEx_Task,omitempty"` + Res *types.ConnectNvmeControllerEx_TaskResponse `xml:"ConnectNvmeControllerEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ConnectNvmeControllerEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ConnectNvmeControllerEx_Task(ctx context.Context, r soap.RoundTripper, req *types.ConnectNvmeControllerEx_Task) (*types.ConnectNvmeControllerEx_TaskResponse, error) { + var reqBody, resBody ConnectNvmeControllerEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type ConsolidateVMDisks_TaskBody struct { Req *types.ConsolidateVMDisks_Task `xml:"urn:vim25 ConsolidateVMDisks_Task,omitempty"` - Res *types.ConsolidateVMDisks_TaskResponse `xml:"urn:vim25 ConsolidateVMDisks_TaskResponse,omitempty"` + Res *types.ConsolidateVMDisks_TaskResponse `xml:"ConsolidateVMDisks_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2165,7 +2345,7 @@ func ConsolidateVMDisks_Task(ctx context.Context, r soap.RoundTripper, req *type type ContinueRetrievePropertiesExBody struct { Req *types.ContinueRetrievePropertiesEx `xml:"urn:vim25 ContinueRetrievePropertiesEx,omitempty"` - Res *types.ContinueRetrievePropertiesExResponse `xml:"urn:vim25 ContinueRetrievePropertiesExResponse,omitempty"` + Res *types.ContinueRetrievePropertiesExResponse `xml:"ContinueRetrievePropertiesExResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2185,7 +2365,7 @@ func ContinueRetrievePropertiesEx(ctx context.Context, r soap.RoundTripper, req type ConvertNamespacePathToUuidPathBody struct { Req *types.ConvertNamespacePathToUuidPath `xml:"urn:vim25 ConvertNamespacePathToUuidPath,omitempty"` - Res *types.ConvertNamespacePathToUuidPathResponse `xml:"urn:vim25 ConvertNamespacePathToUuidPathResponse,omitempty"` + Res *types.ConvertNamespacePathToUuidPathResponse `xml:"ConvertNamespacePathToUuidPathResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2205,7 +2385,7 @@ func ConvertNamespacePathToUuidPath(ctx context.Context, r soap.RoundTripper, re type CopyDatastoreFile_TaskBody struct { Req *types.CopyDatastoreFile_Task `xml:"urn:vim25 CopyDatastoreFile_Task,omitempty"` - Res *types.CopyDatastoreFile_TaskResponse `xml:"urn:vim25 CopyDatastoreFile_TaskResponse,omitempty"` + Res *types.CopyDatastoreFile_TaskResponse `xml:"CopyDatastoreFile_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2225,7 +2405,7 @@ func CopyDatastoreFile_Task(ctx context.Context, r soap.RoundTripper, req *types type CopyVirtualDisk_TaskBody struct { Req *types.CopyVirtualDisk_Task `xml:"urn:vim25 CopyVirtualDisk_Task,omitempty"` - Res *types.CopyVirtualDisk_TaskResponse `xml:"urn:vim25 CopyVirtualDisk_TaskResponse,omitempty"` + Res *types.CopyVirtualDisk_TaskResponse `xml:"CopyVirtualDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2245,7 +2425,7 @@ func CopyVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.C type CreateAlarmBody struct { Req *types.CreateAlarm `xml:"urn:vim25 CreateAlarm,omitempty"` - Res *types.CreateAlarmResponse `xml:"urn:vim25 CreateAlarmResponse,omitempty"` + Res *types.CreateAlarmResponse `xml:"CreateAlarmResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2265,7 +2445,7 @@ func CreateAlarm(ctx context.Context, r soap.RoundTripper, req *types.CreateAlar type CreateChildVM_TaskBody struct { Req *types.CreateChildVM_Task `xml:"urn:vim25 CreateChildVM_Task,omitempty"` - Res *types.CreateChildVM_TaskResponse `xml:"urn:vim25 CreateChildVM_TaskResponse,omitempty"` + Res *types.CreateChildVM_TaskResponse `xml:"CreateChildVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2285,7 +2465,7 @@ func CreateChildVM_Task(ctx context.Context, r soap.RoundTripper, req *types.Cre type CreateClusterBody struct { Req *types.CreateCluster `xml:"urn:vim25 CreateCluster,omitempty"` - Res *types.CreateClusterResponse `xml:"urn:vim25 CreateClusterResponse,omitempty"` + Res *types.CreateClusterResponse `xml:"CreateClusterResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2305,7 +2485,7 @@ func CreateCluster(ctx context.Context, r soap.RoundTripper, req *types.CreateCl type CreateClusterExBody struct { Req *types.CreateClusterEx `xml:"urn:vim25 CreateClusterEx,omitempty"` - Res *types.CreateClusterExResponse `xml:"urn:vim25 CreateClusterExResponse,omitempty"` + Res *types.CreateClusterExResponse `xml:"CreateClusterExResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2325,7 +2505,7 @@ func CreateClusterEx(ctx context.Context, r soap.RoundTripper, req *types.Create type CreateCollectorForEventsBody struct { Req *types.CreateCollectorForEvents `xml:"urn:vim25 CreateCollectorForEvents,omitempty"` - Res *types.CreateCollectorForEventsResponse `xml:"urn:vim25 CreateCollectorForEventsResponse,omitempty"` + Res *types.CreateCollectorForEventsResponse `xml:"CreateCollectorForEventsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2345,7 +2525,7 @@ func CreateCollectorForEvents(ctx context.Context, r soap.RoundTripper, req *typ type CreateCollectorForTasksBody struct { Req *types.CreateCollectorForTasks `xml:"urn:vim25 CreateCollectorForTasks,omitempty"` - Res *types.CreateCollectorForTasksResponse `xml:"urn:vim25 CreateCollectorForTasksResponse,omitempty"` + Res *types.CreateCollectorForTasksResponse `xml:"CreateCollectorForTasksResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2365,7 +2545,7 @@ func CreateCollectorForTasks(ctx context.Context, r soap.RoundTripper, req *type type CreateContainerViewBody struct { Req *types.CreateContainerView `xml:"urn:vim25 CreateContainerView,omitempty"` - Res *types.CreateContainerViewResponse `xml:"urn:vim25 CreateContainerViewResponse,omitempty"` + Res *types.CreateContainerViewResponse `xml:"CreateContainerViewResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2385,7 +2565,7 @@ func CreateContainerView(ctx context.Context, r soap.RoundTripper, req *types.Cr type CreateCustomizationSpecBody struct { Req *types.CreateCustomizationSpec `xml:"urn:vim25 CreateCustomizationSpec,omitempty"` - Res *types.CreateCustomizationSpecResponse `xml:"urn:vim25 CreateCustomizationSpecResponse,omitempty"` + Res *types.CreateCustomizationSpecResponse `xml:"CreateCustomizationSpecResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2405,7 +2585,7 @@ func CreateCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *type type CreateDVPortgroup_TaskBody struct { Req *types.CreateDVPortgroup_Task `xml:"urn:vim25 CreateDVPortgroup_Task,omitempty"` - Res *types.CreateDVPortgroup_TaskResponse `xml:"urn:vim25 CreateDVPortgroup_TaskResponse,omitempty"` + Res *types.CreateDVPortgroup_TaskResponse `xml:"CreateDVPortgroup_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2425,7 +2605,7 @@ func CreateDVPortgroup_Task(ctx context.Context, r soap.RoundTripper, req *types type CreateDVS_TaskBody struct { Req *types.CreateDVS_Task `xml:"urn:vim25 CreateDVS_Task,omitempty"` - Res *types.CreateDVS_TaskResponse `xml:"urn:vim25 CreateDVS_TaskResponse,omitempty"` + Res *types.CreateDVS_TaskResponse `xml:"CreateDVS_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2445,7 +2625,7 @@ func CreateDVS_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateD type CreateDatacenterBody struct { Req *types.CreateDatacenter `xml:"urn:vim25 CreateDatacenter,omitempty"` - Res *types.CreateDatacenterResponse `xml:"urn:vim25 CreateDatacenterResponse,omitempty"` + Res *types.CreateDatacenterResponse `xml:"CreateDatacenterResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2465,7 +2645,7 @@ func CreateDatacenter(ctx context.Context, r soap.RoundTripper, req *types.Creat type CreateDefaultProfileBody struct { Req *types.CreateDefaultProfile `xml:"urn:vim25 CreateDefaultProfile,omitempty"` - Res *types.CreateDefaultProfileResponse `xml:"urn:vim25 CreateDefaultProfileResponse,omitempty"` + Res *types.CreateDefaultProfileResponse `xml:"CreateDefaultProfileResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2485,7 +2665,7 @@ func CreateDefaultProfile(ctx context.Context, r soap.RoundTripper, req *types.C type CreateDescriptorBody struct { Req *types.CreateDescriptor `xml:"urn:vim25 CreateDescriptor,omitempty"` - Res *types.CreateDescriptorResponse `xml:"urn:vim25 CreateDescriptorResponse,omitempty"` + Res *types.CreateDescriptorResponse `xml:"CreateDescriptorResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2505,7 +2685,7 @@ func CreateDescriptor(ctx context.Context, r soap.RoundTripper, req *types.Creat type CreateDiagnosticPartitionBody struct { Req *types.CreateDiagnosticPartition `xml:"urn:vim25 CreateDiagnosticPartition,omitempty"` - Res *types.CreateDiagnosticPartitionResponse `xml:"urn:vim25 CreateDiagnosticPartitionResponse,omitempty"` + Res *types.CreateDiagnosticPartitionResponse `xml:"CreateDiagnosticPartitionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2525,7 +2705,7 @@ func CreateDiagnosticPartition(ctx context.Context, r soap.RoundTripper, req *ty type CreateDirectoryBody struct { Req *types.CreateDirectory `xml:"urn:vim25 CreateDirectory,omitempty"` - Res *types.CreateDirectoryResponse `xml:"urn:vim25 CreateDirectoryResponse,omitempty"` + Res *types.CreateDirectoryResponse `xml:"CreateDirectoryResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2545,7 +2725,7 @@ func CreateDirectory(ctx context.Context, r soap.RoundTripper, req *types.Create type CreateDiskFromSnapshot_TaskBody struct { Req *types.CreateDiskFromSnapshot_Task `xml:"urn:vim25 CreateDiskFromSnapshot_Task,omitempty"` - Res *types.CreateDiskFromSnapshot_TaskResponse `xml:"urn:vim25 CreateDiskFromSnapshot_TaskResponse,omitempty"` + Res *types.CreateDiskFromSnapshot_TaskResponse `xml:"CreateDiskFromSnapshot_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2565,7 +2745,7 @@ func CreateDiskFromSnapshot_Task(ctx context.Context, r soap.RoundTripper, req * type CreateDisk_TaskBody struct { Req *types.CreateDisk_Task `xml:"urn:vim25 CreateDisk_Task,omitempty"` - Res *types.CreateDisk_TaskResponse `xml:"urn:vim25 CreateDisk_TaskResponse,omitempty"` + Res *types.CreateDisk_TaskResponse `xml:"CreateDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2585,7 +2765,7 @@ func CreateDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.Create type CreateFilterBody struct { Req *types.CreateFilter `xml:"urn:vim25 CreateFilter,omitempty"` - Res *types.CreateFilterResponse `xml:"urn:vim25 CreateFilterResponse,omitempty"` + Res *types.CreateFilterResponse `xml:"CreateFilterResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2605,7 +2785,7 @@ func CreateFilter(ctx context.Context, r soap.RoundTripper, req *types.CreateFil type CreateFolderBody struct { Req *types.CreateFolder `xml:"urn:vim25 CreateFolder,omitempty"` - Res *types.CreateFolderResponse `xml:"urn:vim25 CreateFolderResponse,omitempty"` + Res *types.CreateFolderResponse `xml:"CreateFolderResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2625,7 +2805,7 @@ func CreateFolder(ctx context.Context, r soap.RoundTripper, req *types.CreateFol type CreateGroupBody struct { Req *types.CreateGroup `xml:"urn:vim25 CreateGroup,omitempty"` - Res *types.CreateGroupResponse `xml:"urn:vim25 CreateGroupResponse,omitempty"` + Res *types.CreateGroupResponse `xml:"CreateGroupResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2645,7 +2825,7 @@ func CreateGroup(ctx context.Context, r soap.RoundTripper, req *types.CreateGrou type CreateImportSpecBody struct { Req *types.CreateImportSpec `xml:"urn:vim25 CreateImportSpec,omitempty"` - Res *types.CreateImportSpecResponse `xml:"urn:vim25 CreateImportSpecResponse,omitempty"` + Res *types.CreateImportSpecResponse `xml:"CreateImportSpecResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2665,7 +2845,7 @@ func CreateImportSpec(ctx context.Context, r soap.RoundTripper, req *types.Creat type CreateInventoryViewBody struct { Req *types.CreateInventoryView `xml:"urn:vim25 CreateInventoryView,omitempty"` - Res *types.CreateInventoryViewResponse `xml:"urn:vim25 CreateInventoryViewResponse,omitempty"` + Res *types.CreateInventoryViewResponse `xml:"CreateInventoryViewResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2685,7 +2865,7 @@ func CreateInventoryView(ctx context.Context, r soap.RoundTripper, req *types.Cr type CreateIpPoolBody struct { Req *types.CreateIpPool `xml:"urn:vim25 CreateIpPool,omitempty"` - Res *types.CreateIpPoolResponse `xml:"urn:vim25 CreateIpPoolResponse,omitempty"` + Res *types.CreateIpPoolResponse `xml:"CreateIpPoolResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2705,7 +2885,7 @@ func CreateIpPool(ctx context.Context, r soap.RoundTripper, req *types.CreateIpP type CreateListViewBody struct { Req *types.CreateListView `xml:"urn:vim25 CreateListView,omitempty"` - Res *types.CreateListViewResponse `xml:"urn:vim25 CreateListViewResponse,omitempty"` + Res *types.CreateListViewResponse `xml:"CreateListViewResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2725,7 +2905,7 @@ func CreateListView(ctx context.Context, r soap.RoundTripper, req *types.CreateL type CreateListViewFromViewBody struct { Req *types.CreateListViewFromView `xml:"urn:vim25 CreateListViewFromView,omitempty"` - Res *types.CreateListViewFromViewResponse `xml:"urn:vim25 CreateListViewFromViewResponse,omitempty"` + Res *types.CreateListViewFromViewResponse `xml:"CreateListViewFromViewResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2745,7 +2925,7 @@ func CreateListViewFromView(ctx context.Context, r soap.RoundTripper, req *types type CreateLocalDatastoreBody struct { Req *types.CreateLocalDatastore `xml:"urn:vim25 CreateLocalDatastore,omitempty"` - Res *types.CreateLocalDatastoreResponse `xml:"urn:vim25 CreateLocalDatastoreResponse,omitempty"` + Res *types.CreateLocalDatastoreResponse `xml:"CreateLocalDatastoreResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2765,7 +2945,7 @@ func CreateLocalDatastore(ctx context.Context, r soap.RoundTripper, req *types.C type CreateNasDatastoreBody struct { Req *types.CreateNasDatastore `xml:"urn:vim25 CreateNasDatastore,omitempty"` - Res *types.CreateNasDatastoreResponse `xml:"urn:vim25 CreateNasDatastoreResponse,omitempty"` + Res *types.CreateNasDatastoreResponse `xml:"CreateNasDatastoreResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2785,7 +2965,7 @@ func CreateNasDatastore(ctx context.Context, r soap.RoundTripper, req *types.Cre type CreateNvdimmNamespace_TaskBody struct { Req *types.CreateNvdimmNamespace_Task `xml:"urn:vim25 CreateNvdimmNamespace_Task,omitempty"` - Res *types.CreateNvdimmNamespace_TaskResponse `xml:"urn:vim25 CreateNvdimmNamespace_TaskResponse,omitempty"` + Res *types.CreateNvdimmNamespace_TaskResponse `xml:"CreateNvdimmNamespace_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2803,9 +2983,49 @@ func CreateNvdimmNamespace_Task(ctx context.Context, r soap.RoundTripper, req *t return resBody.Res, nil } +type CreateNvdimmPMemNamespace_TaskBody struct { + Req *types.CreateNvdimmPMemNamespace_Task `xml:"urn:vim25 CreateNvdimmPMemNamespace_Task,omitempty"` + Res *types.CreateNvdimmPMemNamespace_TaskResponse `xml:"CreateNvdimmPMemNamespace_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateNvdimmPMemNamespace_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateNvdimmPMemNamespace_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateNvdimmPMemNamespace_Task) (*types.CreateNvdimmPMemNamespace_TaskResponse, error) { + var reqBody, resBody CreateNvdimmPMemNamespace_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type CreateNvmeOverRdmaAdapterBody struct { + Req *types.CreateNvmeOverRdmaAdapter `xml:"urn:vim25 CreateNvmeOverRdmaAdapter,omitempty"` + Res *types.CreateNvmeOverRdmaAdapterResponse `xml:"CreateNvmeOverRdmaAdapterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateNvmeOverRdmaAdapterBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateNvmeOverRdmaAdapter(ctx context.Context, r soap.RoundTripper, req *types.CreateNvmeOverRdmaAdapter) (*types.CreateNvmeOverRdmaAdapterResponse, error) { + var reqBody, resBody CreateNvmeOverRdmaAdapterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type CreateObjectScheduledTaskBody struct { Req *types.CreateObjectScheduledTask `xml:"urn:vim25 CreateObjectScheduledTask,omitempty"` - Res *types.CreateObjectScheduledTaskResponse `xml:"urn:vim25 CreateObjectScheduledTaskResponse,omitempty"` + Res *types.CreateObjectScheduledTaskResponse `xml:"CreateObjectScheduledTaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2825,7 +3045,7 @@ func CreateObjectScheduledTask(ctx context.Context, r soap.RoundTripper, req *ty type CreatePerfIntervalBody struct { Req *types.CreatePerfInterval `xml:"urn:vim25 CreatePerfInterval,omitempty"` - Res *types.CreatePerfIntervalResponse `xml:"urn:vim25 CreatePerfIntervalResponse,omitempty"` + Res *types.CreatePerfIntervalResponse `xml:"CreatePerfIntervalResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2845,7 +3065,7 @@ func CreatePerfInterval(ctx context.Context, r soap.RoundTripper, req *types.Cre type CreateProfileBody struct { Req *types.CreateProfile `xml:"urn:vim25 CreateProfile,omitempty"` - Res *types.CreateProfileResponse `xml:"urn:vim25 CreateProfileResponse,omitempty"` + Res *types.CreateProfileResponse `xml:"CreateProfileResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2865,7 +3085,7 @@ func CreateProfile(ctx context.Context, r soap.RoundTripper, req *types.CreatePr type CreatePropertyCollectorBody struct { Req *types.CreatePropertyCollector `xml:"urn:vim25 CreatePropertyCollector,omitempty"` - Res *types.CreatePropertyCollectorResponse `xml:"urn:vim25 CreatePropertyCollectorResponse,omitempty"` + Res *types.CreatePropertyCollectorResponse `xml:"CreatePropertyCollectorResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2885,7 +3105,7 @@ func CreatePropertyCollector(ctx context.Context, r soap.RoundTripper, req *type type CreateRegistryKeyInGuestBody struct { Req *types.CreateRegistryKeyInGuest `xml:"urn:vim25 CreateRegistryKeyInGuest,omitempty"` - Res *types.CreateRegistryKeyInGuestResponse `xml:"urn:vim25 CreateRegistryKeyInGuestResponse,omitempty"` + Res *types.CreateRegistryKeyInGuestResponse `xml:"CreateRegistryKeyInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2905,7 +3125,7 @@ func CreateRegistryKeyInGuest(ctx context.Context, r soap.RoundTripper, req *typ type CreateResourcePoolBody struct { Req *types.CreateResourcePool `xml:"urn:vim25 CreateResourcePool,omitempty"` - Res *types.CreateResourcePoolResponse `xml:"urn:vim25 CreateResourcePoolResponse,omitempty"` + Res *types.CreateResourcePoolResponse `xml:"CreateResourcePoolResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2925,7 +3145,7 @@ func CreateResourcePool(ctx context.Context, r soap.RoundTripper, req *types.Cre type CreateScheduledTaskBody struct { Req *types.CreateScheduledTask `xml:"urn:vim25 CreateScheduledTask,omitempty"` - Res *types.CreateScheduledTaskResponse `xml:"urn:vim25 CreateScheduledTaskResponse,omitempty"` + Res *types.CreateScheduledTaskResponse `xml:"CreateScheduledTaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2945,7 +3165,7 @@ func CreateScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.Cr type CreateScreenshot_TaskBody struct { Req *types.CreateScreenshot_Task `xml:"urn:vim25 CreateScreenshot_Task,omitempty"` - Res *types.CreateScreenshot_TaskResponse `xml:"urn:vim25 CreateScreenshot_TaskResponse,omitempty"` + Res *types.CreateScreenshot_TaskResponse `xml:"CreateScreenshot_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2965,7 +3185,7 @@ func CreateScreenshot_Task(ctx context.Context, r soap.RoundTripper, req *types. type CreateSecondaryVMEx_TaskBody struct { Req *types.CreateSecondaryVMEx_Task `xml:"urn:vim25 CreateSecondaryVMEx_Task,omitempty"` - Res *types.CreateSecondaryVMEx_TaskResponse `xml:"urn:vim25 CreateSecondaryVMEx_TaskResponse,omitempty"` + Res *types.CreateSecondaryVMEx_TaskResponse `xml:"CreateSecondaryVMEx_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -2985,7 +3205,7 @@ func CreateSecondaryVMEx_Task(ctx context.Context, r soap.RoundTripper, req *typ type CreateSecondaryVM_TaskBody struct { Req *types.CreateSecondaryVM_Task `xml:"urn:vim25 CreateSecondaryVM_Task,omitempty"` - Res *types.CreateSecondaryVM_TaskResponse `xml:"urn:vim25 CreateSecondaryVM_TaskResponse,omitempty"` + Res *types.CreateSecondaryVM_TaskResponse `xml:"CreateSecondaryVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3005,7 +3225,7 @@ func CreateSecondaryVM_Task(ctx context.Context, r soap.RoundTripper, req *types type CreateSnapshotEx_TaskBody struct { Req *types.CreateSnapshotEx_Task `xml:"urn:vim25 CreateSnapshotEx_Task,omitempty"` - Res *types.CreateSnapshotEx_TaskResponse `xml:"urn:vim25 CreateSnapshotEx_TaskResponse,omitempty"` + Res *types.CreateSnapshotEx_TaskResponse `xml:"CreateSnapshotEx_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3025,7 +3245,7 @@ func CreateSnapshotEx_Task(ctx context.Context, r soap.RoundTripper, req *types. type CreateSnapshot_TaskBody struct { Req *types.CreateSnapshot_Task `xml:"urn:vim25 CreateSnapshot_Task,omitempty"` - Res *types.CreateSnapshot_TaskResponse `xml:"urn:vim25 CreateSnapshot_TaskResponse,omitempty"` + Res *types.CreateSnapshot_TaskResponse `xml:"CreateSnapshot_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3043,9 +3263,29 @@ func CreateSnapshot_Task(ctx context.Context, r soap.RoundTripper, req *types.Cr return resBody.Res, nil } +type CreateSoftwareAdapterBody struct { + Req *types.CreateSoftwareAdapter `xml:"urn:vim25 CreateSoftwareAdapter,omitempty"` + Res *types.CreateSoftwareAdapterResponse `xml:"CreateSoftwareAdapterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CreateSoftwareAdapterBody) Fault() *soap.Fault { return b.Fault_ } + +func CreateSoftwareAdapter(ctx context.Context, r soap.RoundTripper, req *types.CreateSoftwareAdapter) (*types.CreateSoftwareAdapterResponse, error) { + var reqBody, resBody CreateSoftwareAdapterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type CreateStoragePodBody struct { Req *types.CreateStoragePod `xml:"urn:vim25 CreateStoragePod,omitempty"` - Res *types.CreateStoragePodResponse `xml:"urn:vim25 CreateStoragePodResponse,omitempty"` + Res *types.CreateStoragePodResponse `xml:"CreateStoragePodResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3065,7 +3305,7 @@ func CreateStoragePod(ctx context.Context, r soap.RoundTripper, req *types.Creat type CreateTaskBody struct { Req *types.CreateTask `xml:"urn:vim25 CreateTask,omitempty"` - Res *types.CreateTaskResponse `xml:"urn:vim25 CreateTaskResponse,omitempty"` + Res *types.CreateTaskResponse `xml:"CreateTaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3085,7 +3325,7 @@ func CreateTask(ctx context.Context, r soap.RoundTripper, req *types.CreateTask) type CreateTemporaryDirectoryInGuestBody struct { Req *types.CreateTemporaryDirectoryInGuest `xml:"urn:vim25 CreateTemporaryDirectoryInGuest,omitempty"` - Res *types.CreateTemporaryDirectoryInGuestResponse `xml:"urn:vim25 CreateTemporaryDirectoryInGuestResponse,omitempty"` + Res *types.CreateTemporaryDirectoryInGuestResponse `xml:"CreateTemporaryDirectoryInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3105,7 +3345,7 @@ func CreateTemporaryDirectoryInGuest(ctx context.Context, r soap.RoundTripper, r type CreateTemporaryFileInGuestBody struct { Req *types.CreateTemporaryFileInGuest `xml:"urn:vim25 CreateTemporaryFileInGuest,omitempty"` - Res *types.CreateTemporaryFileInGuestResponse `xml:"urn:vim25 CreateTemporaryFileInGuestResponse,omitempty"` + Res *types.CreateTemporaryFileInGuestResponse `xml:"CreateTemporaryFileInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3125,7 +3365,7 @@ func CreateTemporaryFileInGuest(ctx context.Context, r soap.RoundTripper, req *t type CreateUserBody struct { Req *types.CreateUser `xml:"urn:vim25 CreateUser,omitempty"` - Res *types.CreateUserResponse `xml:"urn:vim25 CreateUserResponse,omitempty"` + Res *types.CreateUserResponse `xml:"CreateUserResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3145,7 +3385,7 @@ func CreateUser(ctx context.Context, r soap.RoundTripper, req *types.CreateUser) type CreateVAppBody struct { Req *types.CreateVApp `xml:"urn:vim25 CreateVApp,omitempty"` - Res *types.CreateVAppResponse `xml:"urn:vim25 CreateVAppResponse,omitempty"` + Res *types.CreateVAppResponse `xml:"CreateVAppResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3165,7 +3405,7 @@ func CreateVApp(ctx context.Context, r soap.RoundTripper, req *types.CreateVApp) type CreateVM_TaskBody struct { Req *types.CreateVM_Task `xml:"urn:vim25 CreateVM_Task,omitempty"` - Res *types.CreateVM_TaskResponse `xml:"urn:vim25 CreateVM_TaskResponse,omitempty"` + Res *types.CreateVM_TaskResponse `xml:"CreateVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3185,7 +3425,7 @@ func CreateVM_Task(ctx context.Context, r soap.RoundTripper, req *types.CreateVM type CreateVirtualDisk_TaskBody struct { Req *types.CreateVirtualDisk_Task `xml:"urn:vim25 CreateVirtualDisk_Task,omitempty"` - Res *types.CreateVirtualDisk_TaskResponse `xml:"urn:vim25 CreateVirtualDisk_TaskResponse,omitempty"` + Res *types.CreateVirtualDisk_TaskResponse `xml:"CreateVirtualDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3205,7 +3445,7 @@ func CreateVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types type CreateVmfsDatastoreBody struct { Req *types.CreateVmfsDatastore `xml:"urn:vim25 CreateVmfsDatastore,omitempty"` - Res *types.CreateVmfsDatastoreResponse `xml:"urn:vim25 CreateVmfsDatastoreResponse,omitempty"` + Res *types.CreateVmfsDatastoreResponse `xml:"CreateVmfsDatastoreResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3225,7 +3465,7 @@ func CreateVmfsDatastore(ctx context.Context, r soap.RoundTripper, req *types.Cr type CreateVvolDatastoreBody struct { Req *types.CreateVvolDatastore `xml:"urn:vim25 CreateVvolDatastore,omitempty"` - Res *types.CreateVvolDatastoreResponse `xml:"urn:vim25 CreateVvolDatastoreResponse,omitempty"` + Res *types.CreateVvolDatastoreResponse `xml:"CreateVvolDatastoreResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3243,9 +3483,29 @@ func CreateVvolDatastore(ctx context.Context, r soap.RoundTripper, req *types.Cr return resBody.Res, nil } +type CryptoManagerHostDisableBody struct { + Req *types.CryptoManagerHostDisable `xml:"urn:vim25 CryptoManagerHostDisable,omitempty"` + Res *types.CryptoManagerHostDisableResponse `xml:"CryptoManagerHostDisableResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CryptoManagerHostDisableBody) Fault() *soap.Fault { return b.Fault_ } + +func CryptoManagerHostDisable(ctx context.Context, r soap.RoundTripper, req *types.CryptoManagerHostDisable) (*types.CryptoManagerHostDisableResponse, error) { + var reqBody, resBody CryptoManagerHostDisableBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type CryptoManagerHostEnableBody struct { Req *types.CryptoManagerHostEnable `xml:"urn:vim25 CryptoManagerHostEnable,omitempty"` - Res *types.CryptoManagerHostEnableResponse `xml:"urn:vim25 CryptoManagerHostEnableResponse,omitempty"` + Res *types.CryptoManagerHostEnableResponse `xml:"CryptoManagerHostEnableResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3265,7 +3525,7 @@ func CryptoManagerHostEnable(ctx context.Context, r soap.RoundTripper, req *type type CryptoManagerHostPrepareBody struct { Req *types.CryptoManagerHostPrepare `xml:"urn:vim25 CryptoManagerHostPrepare,omitempty"` - Res *types.CryptoManagerHostPrepareResponse `xml:"urn:vim25 CryptoManagerHostPrepareResponse,omitempty"` + Res *types.CryptoManagerHostPrepareResponse `xml:"CryptoManagerHostPrepareResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3285,7 +3545,7 @@ func CryptoManagerHostPrepare(ctx context.Context, r soap.RoundTripper, req *typ type CryptoUnlock_TaskBody struct { Req *types.CryptoUnlock_Task `xml:"urn:vim25 CryptoUnlock_Task,omitempty"` - Res *types.CryptoUnlock_TaskResponse `xml:"urn:vim25 CryptoUnlock_TaskResponse,omitempty"` + Res *types.CryptoUnlock_TaskResponse `xml:"CryptoUnlock_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3305,7 +3565,7 @@ func CryptoUnlock_Task(ctx context.Context, r soap.RoundTripper, req *types.Cryp type CurrentTimeBody struct { Req *types.CurrentTime `xml:"urn:vim25 CurrentTime,omitempty"` - Res *types.CurrentTimeResponse `xml:"urn:vim25 CurrentTimeResponse,omitempty"` + Res *types.CurrentTimeResponse `xml:"CurrentTimeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3325,7 +3585,7 @@ func CurrentTime(ctx context.Context, r soap.RoundTripper, req *types.CurrentTim type CustomizationSpecItemToXmlBody struct { Req *types.CustomizationSpecItemToXml `xml:"urn:vim25 CustomizationSpecItemToXml,omitempty"` - Res *types.CustomizationSpecItemToXmlResponse `xml:"urn:vim25 CustomizationSpecItemToXmlResponse,omitempty"` + Res *types.CustomizationSpecItemToXmlResponse `xml:"CustomizationSpecItemToXmlResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3343,9 +3603,29 @@ func CustomizationSpecItemToXml(ctx context.Context, r soap.RoundTripper, req *t return resBody.Res, nil } +type CustomizeGuest_TaskBody struct { + Req *types.CustomizeGuest_Task `xml:"urn:vim25 CustomizeGuest_Task,omitempty"` + Res *types.CustomizeGuest_TaskResponse `xml:"CustomizeGuest_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *CustomizeGuest_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func CustomizeGuest_Task(ctx context.Context, r soap.RoundTripper, req *types.CustomizeGuest_Task) (*types.CustomizeGuest_TaskResponse, error) { + var reqBody, resBody CustomizeGuest_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type CustomizeVM_TaskBody struct { Req *types.CustomizeVM_Task `xml:"urn:vim25 CustomizeVM_Task,omitempty"` - Res *types.CustomizeVM_TaskResponse `xml:"urn:vim25 CustomizeVM_TaskResponse,omitempty"` + Res *types.CustomizeVM_TaskResponse `xml:"CustomizeVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3365,7 +3645,7 @@ func CustomizeVM_Task(ctx context.Context, r soap.RoundTripper, req *types.Custo type DVPortgroupRollback_TaskBody struct { Req *types.DVPortgroupRollback_Task `xml:"urn:vim25 DVPortgroupRollback_Task,omitempty"` - Res *types.DVPortgroupRollback_TaskResponse `xml:"urn:vim25 DVPortgroupRollback_TaskResponse,omitempty"` + Res *types.DVPortgroupRollback_TaskResponse `xml:"DVPortgroupRollback_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3385,7 +3665,7 @@ func DVPortgroupRollback_Task(ctx context.Context, r soap.RoundTripper, req *typ type DVSManagerExportEntity_TaskBody struct { Req *types.DVSManagerExportEntity_Task `xml:"urn:vim25 DVSManagerExportEntity_Task,omitempty"` - Res *types.DVSManagerExportEntity_TaskResponse `xml:"urn:vim25 DVSManagerExportEntity_TaskResponse,omitempty"` + Res *types.DVSManagerExportEntity_TaskResponse `xml:"DVSManagerExportEntity_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3405,7 +3685,7 @@ func DVSManagerExportEntity_Task(ctx context.Context, r soap.RoundTripper, req * type DVSManagerImportEntity_TaskBody struct { Req *types.DVSManagerImportEntity_Task `xml:"urn:vim25 DVSManagerImportEntity_Task,omitempty"` - Res *types.DVSManagerImportEntity_TaskResponse `xml:"urn:vim25 DVSManagerImportEntity_TaskResponse,omitempty"` + Res *types.DVSManagerImportEntity_TaskResponse `xml:"DVSManagerImportEntity_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3425,7 +3705,7 @@ func DVSManagerImportEntity_Task(ctx context.Context, r soap.RoundTripper, req * type DVSManagerLookupDvPortGroupBody struct { Req *types.DVSManagerLookupDvPortGroup `xml:"urn:vim25 DVSManagerLookupDvPortGroup,omitempty"` - Res *types.DVSManagerLookupDvPortGroupResponse `xml:"urn:vim25 DVSManagerLookupDvPortGroupResponse,omitempty"` + Res *types.DVSManagerLookupDvPortGroupResponse `xml:"DVSManagerLookupDvPortGroupResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3445,7 +3725,7 @@ func DVSManagerLookupDvPortGroup(ctx context.Context, r soap.RoundTripper, req * type DVSRollback_TaskBody struct { Req *types.DVSRollback_Task `xml:"urn:vim25 DVSRollback_Task,omitempty"` - Res *types.DVSRollback_TaskResponse `xml:"urn:vim25 DVSRollback_TaskResponse,omitempty"` + Res *types.DVSRollback_TaskResponse `xml:"DVSRollback_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3465,7 +3745,7 @@ func DVSRollback_Task(ctx context.Context, r soap.RoundTripper, req *types.DVSRo type DatastoreEnterMaintenanceModeBody struct { Req *types.DatastoreEnterMaintenanceMode `xml:"urn:vim25 DatastoreEnterMaintenanceMode,omitempty"` - Res *types.DatastoreEnterMaintenanceModeResponse `xml:"urn:vim25 DatastoreEnterMaintenanceModeResponse,omitempty"` + Res *types.DatastoreEnterMaintenanceModeResponse `xml:"DatastoreEnterMaintenanceModeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3485,7 +3765,7 @@ func DatastoreEnterMaintenanceMode(ctx context.Context, r soap.RoundTripper, req type DatastoreExitMaintenanceMode_TaskBody struct { Req *types.DatastoreExitMaintenanceMode_Task `xml:"urn:vim25 DatastoreExitMaintenanceMode_Task,omitempty"` - Res *types.DatastoreExitMaintenanceMode_TaskResponse `xml:"urn:vim25 DatastoreExitMaintenanceMode_TaskResponse,omitempty"` + Res *types.DatastoreExitMaintenanceMode_TaskResponse `xml:"DatastoreExitMaintenanceMode_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3505,7 +3785,7 @@ func DatastoreExitMaintenanceMode_Task(ctx context.Context, r soap.RoundTripper, type DecodeLicenseBody struct { Req *types.DecodeLicense `xml:"urn:vim25 DecodeLicense,omitempty"` - Res *types.DecodeLicenseResponse `xml:"urn:vim25 DecodeLicenseResponse,omitempty"` + Res *types.DecodeLicenseResponse `xml:"DecodeLicenseResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3525,7 +3805,7 @@ func DecodeLicense(ctx context.Context, r soap.RoundTripper, req *types.DecodeLi type DefragmentAllDisksBody struct { Req *types.DefragmentAllDisks `xml:"urn:vim25 DefragmentAllDisks,omitempty"` - Res *types.DefragmentAllDisksResponse `xml:"urn:vim25 DefragmentAllDisksResponse,omitempty"` + Res *types.DefragmentAllDisksResponse `xml:"DefragmentAllDisksResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3545,7 +3825,7 @@ func DefragmentAllDisks(ctx context.Context, r soap.RoundTripper, req *types.Def type DefragmentVirtualDisk_TaskBody struct { Req *types.DefragmentVirtualDisk_Task `xml:"urn:vim25 DefragmentVirtualDisk_Task,omitempty"` - Res *types.DefragmentVirtualDisk_TaskResponse `xml:"urn:vim25 DefragmentVirtualDisk_TaskResponse,omitempty"` + Res *types.DefragmentVirtualDisk_TaskResponse `xml:"DefragmentVirtualDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3565,7 +3845,7 @@ func DefragmentVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *t type DeleteCustomizationSpecBody struct { Req *types.DeleteCustomizationSpec `xml:"urn:vim25 DeleteCustomizationSpec,omitempty"` - Res *types.DeleteCustomizationSpecResponse `xml:"urn:vim25 DeleteCustomizationSpecResponse,omitempty"` + Res *types.DeleteCustomizationSpecResponse `xml:"DeleteCustomizationSpecResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3585,7 +3865,7 @@ func DeleteCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *type type DeleteDatastoreFile_TaskBody struct { Req *types.DeleteDatastoreFile_Task `xml:"urn:vim25 DeleteDatastoreFile_Task,omitempty"` - Res *types.DeleteDatastoreFile_TaskResponse `xml:"urn:vim25 DeleteDatastoreFile_TaskResponse,omitempty"` + Res *types.DeleteDatastoreFile_TaskResponse `xml:"DeleteDatastoreFile_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3605,7 +3885,7 @@ func DeleteDatastoreFile_Task(ctx context.Context, r soap.RoundTripper, req *typ type DeleteDirectoryBody struct { Req *types.DeleteDirectory `xml:"urn:vim25 DeleteDirectory,omitempty"` - Res *types.DeleteDirectoryResponse `xml:"urn:vim25 DeleteDirectoryResponse,omitempty"` + Res *types.DeleteDirectoryResponse `xml:"DeleteDirectoryResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3625,7 +3905,7 @@ func DeleteDirectory(ctx context.Context, r soap.RoundTripper, req *types.Delete type DeleteDirectoryInGuestBody struct { Req *types.DeleteDirectoryInGuest `xml:"urn:vim25 DeleteDirectoryInGuest,omitempty"` - Res *types.DeleteDirectoryInGuestResponse `xml:"urn:vim25 DeleteDirectoryInGuestResponse,omitempty"` + Res *types.DeleteDirectoryInGuestResponse `xml:"DeleteDirectoryInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3645,7 +3925,7 @@ func DeleteDirectoryInGuest(ctx context.Context, r soap.RoundTripper, req *types type DeleteFileBody struct { Req *types.DeleteFile `xml:"urn:vim25 DeleteFile,omitempty"` - Res *types.DeleteFileResponse `xml:"urn:vim25 DeleteFileResponse,omitempty"` + Res *types.DeleteFileResponse `xml:"DeleteFileResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3665,7 +3945,7 @@ func DeleteFile(ctx context.Context, r soap.RoundTripper, req *types.DeleteFile) type DeleteFileInGuestBody struct { Req *types.DeleteFileInGuest `xml:"urn:vim25 DeleteFileInGuest,omitempty"` - Res *types.DeleteFileInGuestResponse `xml:"urn:vim25 DeleteFileInGuestResponse,omitempty"` + Res *types.DeleteFileInGuestResponse `xml:"DeleteFileInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3685,7 +3965,7 @@ func DeleteFileInGuest(ctx context.Context, r soap.RoundTripper, req *types.Dele type DeleteHostSpecificationBody struct { Req *types.DeleteHostSpecification `xml:"urn:vim25 DeleteHostSpecification,omitempty"` - Res *types.DeleteHostSpecificationResponse `xml:"urn:vim25 DeleteHostSpecificationResponse,omitempty"` + Res *types.DeleteHostSpecificationResponse `xml:"DeleteHostSpecificationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3705,7 +3985,7 @@ func DeleteHostSpecification(ctx context.Context, r soap.RoundTripper, req *type type DeleteHostSubSpecificationBody struct { Req *types.DeleteHostSubSpecification `xml:"urn:vim25 DeleteHostSubSpecification,omitempty"` - Res *types.DeleteHostSubSpecificationResponse `xml:"urn:vim25 DeleteHostSubSpecificationResponse,omitempty"` + Res *types.DeleteHostSubSpecificationResponse `xml:"DeleteHostSubSpecificationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3725,7 +4005,7 @@ func DeleteHostSubSpecification(ctx context.Context, r soap.RoundTripper, req *t type DeleteNvdimmBlockNamespaces_TaskBody struct { Req *types.DeleteNvdimmBlockNamespaces_Task `xml:"urn:vim25 DeleteNvdimmBlockNamespaces_Task,omitempty"` - Res *types.DeleteNvdimmBlockNamespaces_TaskResponse `xml:"urn:vim25 DeleteNvdimmBlockNamespaces_TaskResponse,omitempty"` + Res *types.DeleteNvdimmBlockNamespaces_TaskResponse `xml:"DeleteNvdimmBlockNamespaces_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3745,7 +4025,7 @@ func DeleteNvdimmBlockNamespaces_Task(ctx context.Context, r soap.RoundTripper, type DeleteNvdimmNamespace_TaskBody struct { Req *types.DeleteNvdimmNamespace_Task `xml:"urn:vim25 DeleteNvdimmNamespace_Task,omitempty"` - Res *types.DeleteNvdimmNamespace_TaskResponse `xml:"urn:vim25 DeleteNvdimmNamespace_TaskResponse,omitempty"` + Res *types.DeleteNvdimmNamespace_TaskResponse `xml:"DeleteNvdimmNamespace_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3765,7 +4045,7 @@ func DeleteNvdimmNamespace_Task(ctx context.Context, r soap.RoundTripper, req *t type DeleteRegistryKeyInGuestBody struct { Req *types.DeleteRegistryKeyInGuest `xml:"urn:vim25 DeleteRegistryKeyInGuest,omitempty"` - Res *types.DeleteRegistryKeyInGuestResponse `xml:"urn:vim25 DeleteRegistryKeyInGuestResponse,omitempty"` + Res *types.DeleteRegistryKeyInGuestResponse `xml:"DeleteRegistryKeyInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3785,7 +4065,7 @@ func DeleteRegistryKeyInGuest(ctx context.Context, r soap.RoundTripper, req *typ type DeleteRegistryValueInGuestBody struct { Req *types.DeleteRegistryValueInGuest `xml:"urn:vim25 DeleteRegistryValueInGuest,omitempty"` - Res *types.DeleteRegistryValueInGuestResponse `xml:"urn:vim25 DeleteRegistryValueInGuestResponse,omitempty"` + Res *types.DeleteRegistryValueInGuestResponse `xml:"DeleteRegistryValueInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3805,7 +4085,7 @@ func DeleteRegistryValueInGuest(ctx context.Context, r soap.RoundTripper, req *t type DeleteScsiLunStateBody struct { Req *types.DeleteScsiLunState `xml:"urn:vim25 DeleteScsiLunState,omitempty"` - Res *types.DeleteScsiLunStateResponse `xml:"urn:vim25 DeleteScsiLunStateResponse,omitempty"` + Res *types.DeleteScsiLunStateResponse `xml:"DeleteScsiLunStateResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3825,7 +4105,7 @@ func DeleteScsiLunState(ctx context.Context, r soap.RoundTripper, req *types.Del type DeleteSnapshot_TaskBody struct { Req *types.DeleteSnapshot_Task `xml:"urn:vim25 DeleteSnapshot_Task,omitempty"` - Res *types.DeleteSnapshot_TaskResponse `xml:"urn:vim25 DeleteSnapshot_TaskResponse,omitempty"` + Res *types.DeleteSnapshot_TaskResponse `xml:"DeleteSnapshot_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3843,9 +4123,29 @@ 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:"urn:vim25 DeleteVStorageObject_TaskResponse,omitempty"` + Res *types.DeleteVStorageObject_TaskResponse `xml:"DeleteVStorageObject_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3865,7 +4165,7 @@ func DeleteVStorageObject_Task(ctx context.Context, r soap.RoundTripper, req *ty type DeleteVffsVolumeStateBody struct { Req *types.DeleteVffsVolumeState `xml:"urn:vim25 DeleteVffsVolumeState,omitempty"` - Res *types.DeleteVffsVolumeStateResponse `xml:"urn:vim25 DeleteVffsVolumeStateResponse,omitempty"` + Res *types.DeleteVffsVolumeStateResponse `xml:"DeleteVffsVolumeStateResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3885,7 +4185,7 @@ func DeleteVffsVolumeState(ctx context.Context, r soap.RoundTripper, req *types. type DeleteVirtualDisk_TaskBody struct { Req *types.DeleteVirtualDisk_Task `xml:"urn:vim25 DeleteVirtualDisk_Task,omitempty"` - Res *types.DeleteVirtualDisk_TaskResponse `xml:"urn:vim25 DeleteVirtualDisk_TaskResponse,omitempty"` + Res *types.DeleteVirtualDisk_TaskResponse `xml:"DeleteVirtualDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3905,7 +4205,7 @@ func DeleteVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types type DeleteVmfsVolumeStateBody struct { Req *types.DeleteVmfsVolumeState `xml:"urn:vim25 DeleteVmfsVolumeState,omitempty"` - Res *types.DeleteVmfsVolumeStateResponse `xml:"urn:vim25 DeleteVmfsVolumeStateResponse,omitempty"` + Res *types.DeleteVmfsVolumeStateResponse `xml:"DeleteVmfsVolumeStateResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3925,7 +4225,7 @@ func DeleteVmfsVolumeState(ctx context.Context, r soap.RoundTripper, req *types. type DeleteVsanObjectsBody struct { Req *types.DeleteVsanObjects `xml:"urn:vim25 DeleteVsanObjects,omitempty"` - Res *types.DeleteVsanObjectsResponse `xml:"urn:vim25 DeleteVsanObjectsResponse,omitempty"` + Res *types.DeleteVsanObjectsResponse `xml:"DeleteVsanObjectsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3945,7 +4245,7 @@ func DeleteVsanObjects(ctx context.Context, r soap.RoundTripper, req *types.Dele type DeselectVnicBody struct { Req *types.DeselectVnic `xml:"urn:vim25 DeselectVnic,omitempty"` - Res *types.DeselectVnicResponse `xml:"urn:vim25 DeselectVnicResponse,omitempty"` + Res *types.DeselectVnicResponse `xml:"DeselectVnicResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3965,7 +4265,7 @@ func DeselectVnic(ctx context.Context, r soap.RoundTripper, req *types.DeselectV type DeselectVnicForNicTypeBody struct { Req *types.DeselectVnicForNicType `xml:"urn:vim25 DeselectVnicForNicType,omitempty"` - Res *types.DeselectVnicForNicTypeResponse `xml:"urn:vim25 DeselectVnicForNicTypeResponse,omitempty"` + Res *types.DeselectVnicForNicTypeResponse `xml:"DeselectVnicForNicTypeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -3985,7 +4285,7 @@ func DeselectVnicForNicType(ctx context.Context, r soap.RoundTripper, req *types type DestroyChildrenBody struct { Req *types.DestroyChildren `xml:"urn:vim25 DestroyChildren,omitempty"` - Res *types.DestroyChildrenResponse `xml:"urn:vim25 DestroyChildrenResponse,omitempty"` + Res *types.DestroyChildrenResponse `xml:"DestroyChildrenResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4005,7 +4305,7 @@ func DestroyChildren(ctx context.Context, r soap.RoundTripper, req *types.Destro type DestroyCollectorBody struct { Req *types.DestroyCollector `xml:"urn:vim25 DestroyCollector,omitempty"` - Res *types.DestroyCollectorResponse `xml:"urn:vim25 DestroyCollectorResponse,omitempty"` + Res *types.DestroyCollectorResponse `xml:"DestroyCollectorResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4025,7 +4325,7 @@ func DestroyCollector(ctx context.Context, r soap.RoundTripper, req *types.Destr type DestroyDatastoreBody struct { Req *types.DestroyDatastore `xml:"urn:vim25 DestroyDatastore,omitempty"` - Res *types.DestroyDatastoreResponse `xml:"urn:vim25 DestroyDatastoreResponse,omitempty"` + Res *types.DestroyDatastoreResponse `xml:"DestroyDatastoreResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4045,7 +4345,7 @@ func DestroyDatastore(ctx context.Context, r soap.RoundTripper, req *types.Destr type DestroyIpPoolBody struct { Req *types.DestroyIpPool `xml:"urn:vim25 DestroyIpPool,omitempty"` - Res *types.DestroyIpPoolResponse `xml:"urn:vim25 DestroyIpPoolResponse,omitempty"` + Res *types.DestroyIpPoolResponse `xml:"DestroyIpPoolResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4065,7 +4365,7 @@ func DestroyIpPool(ctx context.Context, r soap.RoundTripper, req *types.DestroyI type DestroyNetworkBody struct { Req *types.DestroyNetwork `xml:"urn:vim25 DestroyNetwork,omitempty"` - Res *types.DestroyNetworkResponse `xml:"urn:vim25 DestroyNetworkResponse,omitempty"` + Res *types.DestroyNetworkResponse `xml:"DestroyNetworkResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4085,7 +4385,7 @@ func DestroyNetwork(ctx context.Context, r soap.RoundTripper, req *types.Destroy type DestroyProfileBody struct { Req *types.DestroyProfile `xml:"urn:vim25 DestroyProfile,omitempty"` - Res *types.DestroyProfileResponse `xml:"urn:vim25 DestroyProfileResponse,omitempty"` + Res *types.DestroyProfileResponse `xml:"DestroyProfileResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4105,7 +4405,7 @@ func DestroyProfile(ctx context.Context, r soap.RoundTripper, req *types.Destroy type DestroyPropertyCollectorBody struct { Req *types.DestroyPropertyCollector `xml:"urn:vim25 DestroyPropertyCollector,omitempty"` - Res *types.DestroyPropertyCollectorResponse `xml:"urn:vim25 DestroyPropertyCollectorResponse,omitempty"` + Res *types.DestroyPropertyCollectorResponse `xml:"DestroyPropertyCollectorResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4125,7 +4425,7 @@ func DestroyPropertyCollector(ctx context.Context, r soap.RoundTripper, req *typ type DestroyPropertyFilterBody struct { Req *types.DestroyPropertyFilter `xml:"urn:vim25 DestroyPropertyFilter,omitempty"` - Res *types.DestroyPropertyFilterResponse `xml:"urn:vim25 DestroyPropertyFilterResponse,omitempty"` + Res *types.DestroyPropertyFilterResponse `xml:"DestroyPropertyFilterResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4145,7 +4445,7 @@ func DestroyPropertyFilter(ctx context.Context, r soap.RoundTripper, req *types. type DestroyVffsBody struct { Req *types.DestroyVffs `xml:"urn:vim25 DestroyVffs,omitempty"` - Res *types.DestroyVffsResponse `xml:"urn:vim25 DestroyVffsResponse,omitempty"` + Res *types.DestroyVffsResponse `xml:"DestroyVffsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4165,7 +4465,7 @@ func DestroyVffs(ctx context.Context, r soap.RoundTripper, req *types.DestroyVff type DestroyViewBody struct { Req *types.DestroyView `xml:"urn:vim25 DestroyView,omitempty"` - Res *types.DestroyViewResponse `xml:"urn:vim25 DestroyViewResponse,omitempty"` + Res *types.DestroyViewResponse `xml:"DestroyViewResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4185,7 +4485,7 @@ func DestroyView(ctx context.Context, r soap.RoundTripper, req *types.DestroyVie type Destroy_TaskBody struct { Req *types.Destroy_Task `xml:"urn:vim25 Destroy_Task,omitempty"` - Res *types.Destroy_TaskResponse `xml:"urn:vim25 Destroy_TaskResponse,omitempty"` + Res *types.Destroy_TaskResponse `xml:"Destroy_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4205,7 +4505,7 @@ func Destroy_Task(ctx context.Context, r soap.RoundTripper, req *types.Destroy_T type DetachDisk_TaskBody struct { Req *types.DetachDisk_Task `xml:"urn:vim25 DetachDisk_Task,omitempty"` - Res *types.DetachDisk_TaskResponse `xml:"urn:vim25 DetachDisk_TaskResponse,omitempty"` + Res *types.DetachDisk_TaskResponse `xml:"DetachDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4225,7 +4525,7 @@ func DetachDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.Detach type DetachScsiLunBody struct { Req *types.DetachScsiLun `xml:"urn:vim25 DetachScsiLun,omitempty"` - Res *types.DetachScsiLunResponse `xml:"urn:vim25 DetachScsiLunResponse,omitempty"` + Res *types.DetachScsiLunResponse `xml:"DetachScsiLunResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4245,7 +4545,7 @@ func DetachScsiLun(ctx context.Context, r soap.RoundTripper, req *types.DetachSc type DetachScsiLunEx_TaskBody struct { Req *types.DetachScsiLunEx_Task `xml:"urn:vim25 DetachScsiLunEx_Task,omitempty"` - Res *types.DetachScsiLunEx_TaskResponse `xml:"urn:vim25 DetachScsiLunEx_TaskResponse,omitempty"` + Res *types.DetachScsiLunEx_TaskResponse `xml:"DetachScsiLunEx_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4265,7 +4565,7 @@ func DetachScsiLunEx_Task(ctx context.Context, r soap.RoundTripper, req *types.D type DetachTagFromVStorageObjectBody struct { Req *types.DetachTagFromVStorageObject `xml:"urn:vim25 DetachTagFromVStorageObject,omitempty"` - Res *types.DetachTagFromVStorageObjectResponse `xml:"urn:vim25 DetachTagFromVStorageObjectResponse,omitempty"` + Res *types.DetachTagFromVStorageObjectResponse `xml:"DetachTagFromVStorageObjectResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4283,9 +4583,49 @@ func DetachTagFromVStorageObject(ctx context.Context, r soap.RoundTripper, req * return resBody.Res, nil } +type DisableAlarmBody struct { + Req *types.DisableAlarm `xml:"urn:vim25 DisableAlarm,omitempty"` + Res *types.DisableAlarmResponse `xml:"DisableAlarmResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DisableAlarmBody) Fault() *soap.Fault { return b.Fault_ } + +func DisableAlarm(ctx context.Context, r soap.RoundTripper, req *types.DisableAlarm) (*types.DisableAlarmResponse, error) { + var reqBody, resBody DisableAlarmBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DisableClusteredVmdkSupportBody struct { + Req *types.DisableClusteredVmdkSupport `xml:"urn:vim25 DisableClusteredVmdkSupport,omitempty"` + Res *types.DisableClusteredVmdkSupportResponse `xml:"DisableClusteredVmdkSupportResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DisableClusteredVmdkSupportBody) Fault() *soap.Fault { return b.Fault_ } + +func DisableClusteredVmdkSupport(ctx context.Context, r soap.RoundTripper, req *types.DisableClusteredVmdkSupport) (*types.DisableClusteredVmdkSupportResponse, error) { + var reqBody, resBody DisableClusteredVmdkSupportBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type DisableEvcMode_TaskBody struct { Req *types.DisableEvcMode_Task `xml:"urn:vim25 DisableEvcMode_Task,omitempty"` - Res *types.DisableEvcMode_TaskResponse `xml:"urn:vim25 DisableEvcMode_TaskResponse,omitempty"` + Res *types.DisableEvcMode_TaskResponse `xml:"DisableEvcMode_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4305,7 +4645,7 @@ func DisableEvcMode_Task(ctx context.Context, r soap.RoundTripper, req *types.Di type DisableFeatureBody struct { Req *types.DisableFeature `xml:"urn:vim25 DisableFeature,omitempty"` - Res *types.DisableFeatureResponse `xml:"urn:vim25 DisableFeatureResponse,omitempty"` + Res *types.DisableFeatureResponse `xml:"DisableFeatureResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4325,7 +4665,7 @@ func DisableFeature(ctx context.Context, r soap.RoundTripper, req *types.Disable type DisableHyperThreadingBody struct { Req *types.DisableHyperThreading `xml:"urn:vim25 DisableHyperThreading,omitempty"` - Res *types.DisableHyperThreadingResponse `xml:"urn:vim25 DisableHyperThreadingResponse,omitempty"` + Res *types.DisableHyperThreadingResponse `xml:"DisableHyperThreadingResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4345,7 +4685,7 @@ func DisableHyperThreading(ctx context.Context, r soap.RoundTripper, req *types. type DisableMultipathPathBody struct { Req *types.DisableMultipathPath `xml:"urn:vim25 DisableMultipathPath,omitempty"` - Res *types.DisableMultipathPathResponse `xml:"urn:vim25 DisableMultipathPathResponse,omitempty"` + Res *types.DisableMultipathPathResponse `xml:"DisableMultipathPathResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4365,7 +4705,7 @@ func DisableMultipathPath(ctx context.Context, r soap.RoundTripper, req *types.D type DisableRulesetBody struct { Req *types.DisableRuleset `xml:"urn:vim25 DisableRuleset,omitempty"` - Res *types.DisableRulesetResponse `xml:"urn:vim25 DisableRulesetResponse,omitempty"` + Res *types.DisableRulesetResponse `xml:"DisableRulesetResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4385,7 +4725,7 @@ func DisableRuleset(ctx context.Context, r soap.RoundTripper, req *types.Disable type DisableSecondaryVM_TaskBody struct { Req *types.DisableSecondaryVM_Task `xml:"urn:vim25 DisableSecondaryVM_Task,omitempty"` - Res *types.DisableSecondaryVM_TaskResponse `xml:"urn:vim25 DisableSecondaryVM_TaskResponse,omitempty"` + Res *types.DisableSecondaryVM_TaskResponse `xml:"DisableSecondaryVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4405,7 +4745,7 @@ func DisableSecondaryVM_Task(ctx context.Context, r soap.RoundTripper, req *type type DisableSmartCardAuthenticationBody struct { Req *types.DisableSmartCardAuthentication `xml:"urn:vim25 DisableSmartCardAuthentication,omitempty"` - Res *types.DisableSmartCardAuthenticationResponse `xml:"urn:vim25 DisableSmartCardAuthenticationResponse,omitempty"` + Res *types.DisableSmartCardAuthenticationResponse `xml:"DisableSmartCardAuthenticationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4425,7 +4765,7 @@ func DisableSmartCardAuthentication(ctx context.Context, r soap.RoundTripper, re type DisconnectHost_TaskBody struct { Req *types.DisconnectHost_Task `xml:"urn:vim25 DisconnectHost_Task,omitempty"` - Res *types.DisconnectHost_TaskResponse `xml:"urn:vim25 DisconnectHost_TaskResponse,omitempty"` + Res *types.DisconnectHost_TaskResponse `xml:"DisconnectHost_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4443,9 +4783,49 @@ func DisconnectHost_Task(ctx context.Context, r soap.RoundTripper, req *types.Di return resBody.Res, nil } +type DisconnectNvmeControllerBody struct { + Req *types.DisconnectNvmeController `xml:"urn:vim25 DisconnectNvmeController,omitempty"` + Res *types.DisconnectNvmeControllerResponse `xml:"DisconnectNvmeControllerResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DisconnectNvmeControllerBody) Fault() *soap.Fault { return b.Fault_ } + +func DisconnectNvmeController(ctx context.Context, r soap.RoundTripper, req *types.DisconnectNvmeController) (*types.DisconnectNvmeControllerResponse, error) { + var reqBody, resBody DisconnectNvmeControllerBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type DisconnectNvmeControllerEx_TaskBody struct { + Req *types.DisconnectNvmeControllerEx_Task `xml:"urn:vim25 DisconnectNvmeControllerEx_Task,omitempty"` + Res *types.DisconnectNvmeControllerEx_TaskResponse `xml:"DisconnectNvmeControllerEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DisconnectNvmeControllerEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func DisconnectNvmeControllerEx_Task(ctx context.Context, r soap.RoundTripper, req *types.DisconnectNvmeControllerEx_Task) (*types.DisconnectNvmeControllerEx_TaskResponse, error) { + var reqBody, resBody DisconnectNvmeControllerEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type DiscoverFcoeHbasBody struct { Req *types.DiscoverFcoeHbas `xml:"urn:vim25 DiscoverFcoeHbas,omitempty"` - Res *types.DiscoverFcoeHbasResponse `xml:"urn:vim25 DiscoverFcoeHbasResponse,omitempty"` + Res *types.DiscoverFcoeHbasResponse `xml:"DiscoverFcoeHbasResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4463,9 +4843,29 @@ func DiscoverFcoeHbas(ctx context.Context, r soap.RoundTripper, req *types.Disco return resBody.Res, nil } +type DiscoverNvmeControllersBody struct { + Req *types.DiscoverNvmeControllers `xml:"urn:vim25 DiscoverNvmeControllers,omitempty"` + Res *types.DiscoverNvmeControllersResponse `xml:"DiscoverNvmeControllersResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DiscoverNvmeControllersBody) Fault() *soap.Fault { return b.Fault_ } + +func DiscoverNvmeControllers(ctx context.Context, r soap.RoundTripper, req *types.DiscoverNvmeControllers) (*types.DiscoverNvmeControllersResponse, error) { + var reqBody, resBody DiscoverNvmeControllersBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type DissociateProfileBody struct { Req *types.DissociateProfile `xml:"urn:vim25 DissociateProfile,omitempty"` - Res *types.DissociateProfileResponse `xml:"urn:vim25 DissociateProfileResponse,omitempty"` + Res *types.DissociateProfileResponse `xml:"DissociateProfileResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4485,7 +4885,7 @@ func DissociateProfile(ctx context.Context, r soap.RoundTripper, req *types.Diss type DoesCustomizationSpecExistBody struct { Req *types.DoesCustomizationSpecExist `xml:"urn:vim25 DoesCustomizationSpecExist,omitempty"` - Res *types.DoesCustomizationSpecExistResponse `xml:"urn:vim25 DoesCustomizationSpecExistResponse,omitempty"` + Res *types.DoesCustomizationSpecExistResponse `xml:"DoesCustomizationSpecExistResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4503,9 +4903,49 @@ func DoesCustomizationSpecExist(ctx context.Context, r soap.RoundTripper, req *t return resBody.Res, nil } +type DownloadDescriptionTreeBody struct { + Req *types.DownloadDescriptionTree `xml:"urn:vim25 DownloadDescriptionTree,omitempty"` + Res *types.DownloadDescriptionTreeResponse `xml:"DownloadDescriptionTreeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *DownloadDescriptionTreeBody) Fault() *soap.Fault { return b.Fault_ } + +func DownloadDescriptionTree(ctx context.Context, r soap.RoundTripper, req *types.DownloadDescriptionTree) (*types.DownloadDescriptionTreeResponse, error) { + var reqBody, resBody DownloadDescriptionTreeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + 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:"urn:vim25 DuplicateCustomizationSpecResponse,omitempty"` + Res *types.DuplicateCustomizationSpecResponse `xml:"DuplicateCustomizationSpecResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4525,7 +4965,7 @@ func DuplicateCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *t type DvsReconfigureVmVnicNetworkResourcePool_TaskBody struct { Req *types.DvsReconfigureVmVnicNetworkResourcePool_Task `xml:"urn:vim25 DvsReconfigureVmVnicNetworkResourcePool_Task,omitempty"` - Res *types.DvsReconfigureVmVnicNetworkResourcePool_TaskResponse `xml:"urn:vim25 DvsReconfigureVmVnicNetworkResourcePool_TaskResponse,omitempty"` + Res *types.DvsReconfigureVmVnicNetworkResourcePool_TaskResponse `xml:"DvsReconfigureVmVnicNetworkResourcePool_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4545,7 +4985,7 @@ func DvsReconfigureVmVnicNetworkResourcePool_Task(ctx context.Context, r soap.Ro type EagerZeroVirtualDisk_TaskBody struct { Req *types.EagerZeroVirtualDisk_Task `xml:"urn:vim25 EagerZeroVirtualDisk_Task,omitempty"` - Res *types.EagerZeroVirtualDisk_TaskResponse `xml:"urn:vim25 EagerZeroVirtualDisk_TaskResponse,omitempty"` + Res *types.EagerZeroVirtualDisk_TaskResponse `xml:"EagerZeroVirtualDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4563,9 +5003,29 @@ func EagerZeroVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *ty return resBody.Res, nil } +type EnableAlarmBody struct { + Req *types.EnableAlarm `xml:"urn:vim25 EnableAlarm,omitempty"` + Res *types.EnableAlarmResponse `xml:"EnableAlarmResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EnableAlarmBody) Fault() *soap.Fault { return b.Fault_ } + +func EnableAlarm(ctx context.Context, r soap.RoundTripper, req *types.EnableAlarm) (*types.EnableAlarmResponse, error) { + var reqBody, resBody EnableAlarmBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type EnableAlarmActionsBody struct { Req *types.EnableAlarmActions `xml:"urn:vim25 EnableAlarmActions,omitempty"` - Res *types.EnableAlarmActionsResponse `xml:"urn:vim25 EnableAlarmActionsResponse,omitempty"` + Res *types.EnableAlarmActionsResponse `xml:"EnableAlarmActionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4583,9 +5043,29 @@ func EnableAlarmActions(ctx context.Context, r soap.RoundTripper, req *types.Ena return resBody.Res, nil } +type EnableClusteredVmdkSupportBody struct { + Req *types.EnableClusteredVmdkSupport `xml:"urn:vim25 EnableClusteredVmdkSupport,omitempty"` + Res *types.EnableClusteredVmdkSupportResponse `xml:"EnableClusteredVmdkSupportResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *EnableClusteredVmdkSupportBody) Fault() *soap.Fault { return b.Fault_ } + +func EnableClusteredVmdkSupport(ctx context.Context, r soap.RoundTripper, req *types.EnableClusteredVmdkSupport) (*types.EnableClusteredVmdkSupportResponse, error) { + var reqBody, resBody EnableClusteredVmdkSupportBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type EnableCryptoBody struct { Req *types.EnableCrypto `xml:"urn:vim25 EnableCrypto,omitempty"` - Res *types.EnableCryptoResponse `xml:"urn:vim25 EnableCryptoResponse,omitempty"` + Res *types.EnableCryptoResponse `xml:"EnableCryptoResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4605,7 +5085,7 @@ func EnableCrypto(ctx context.Context, r soap.RoundTripper, req *types.EnableCry type EnableFeatureBody struct { Req *types.EnableFeature `xml:"urn:vim25 EnableFeature,omitempty"` - Res *types.EnableFeatureResponse `xml:"urn:vim25 EnableFeatureResponse,omitempty"` + Res *types.EnableFeatureResponse `xml:"EnableFeatureResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4625,7 +5105,7 @@ func EnableFeature(ctx context.Context, r soap.RoundTripper, req *types.EnableFe type EnableHyperThreadingBody struct { Req *types.EnableHyperThreading `xml:"urn:vim25 EnableHyperThreading,omitempty"` - Res *types.EnableHyperThreadingResponse `xml:"urn:vim25 EnableHyperThreadingResponse,omitempty"` + Res *types.EnableHyperThreadingResponse `xml:"EnableHyperThreadingResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4645,7 +5125,7 @@ func EnableHyperThreading(ctx context.Context, r soap.RoundTripper, req *types.E type EnableMultipathPathBody struct { Req *types.EnableMultipathPath `xml:"urn:vim25 EnableMultipathPath,omitempty"` - Res *types.EnableMultipathPathResponse `xml:"urn:vim25 EnableMultipathPathResponse,omitempty"` + Res *types.EnableMultipathPathResponse `xml:"EnableMultipathPathResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4665,7 +5145,7 @@ func EnableMultipathPath(ctx context.Context, r soap.RoundTripper, req *types.En type EnableNetworkResourceManagementBody struct { Req *types.EnableNetworkResourceManagement `xml:"urn:vim25 EnableNetworkResourceManagement,omitempty"` - Res *types.EnableNetworkResourceManagementResponse `xml:"urn:vim25 EnableNetworkResourceManagementResponse,omitempty"` + Res *types.EnableNetworkResourceManagementResponse `xml:"EnableNetworkResourceManagementResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4685,7 +5165,7 @@ func EnableNetworkResourceManagement(ctx context.Context, r soap.RoundTripper, r type EnableRulesetBody struct { Req *types.EnableRuleset `xml:"urn:vim25 EnableRuleset,omitempty"` - Res *types.EnableRulesetResponse `xml:"urn:vim25 EnableRulesetResponse,omitempty"` + Res *types.EnableRulesetResponse `xml:"EnableRulesetResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4705,7 +5185,7 @@ func EnableRuleset(ctx context.Context, r soap.RoundTripper, req *types.EnableRu type EnableSecondaryVM_TaskBody struct { Req *types.EnableSecondaryVM_Task `xml:"urn:vim25 EnableSecondaryVM_Task,omitempty"` - Res *types.EnableSecondaryVM_TaskResponse `xml:"urn:vim25 EnableSecondaryVM_TaskResponse,omitempty"` + Res *types.EnableSecondaryVM_TaskResponse `xml:"EnableSecondaryVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4725,7 +5205,7 @@ func EnableSecondaryVM_Task(ctx context.Context, r soap.RoundTripper, req *types type EnableSmartCardAuthenticationBody struct { Req *types.EnableSmartCardAuthentication `xml:"urn:vim25 EnableSmartCardAuthentication,omitempty"` - Res *types.EnableSmartCardAuthenticationResponse `xml:"urn:vim25 EnableSmartCardAuthenticationResponse,omitempty"` + Res *types.EnableSmartCardAuthenticationResponse `xml:"EnableSmartCardAuthenticationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4745,7 +5225,7 @@ func EnableSmartCardAuthentication(ctx context.Context, r soap.RoundTripper, req type EnterLockdownModeBody struct { Req *types.EnterLockdownMode `xml:"urn:vim25 EnterLockdownMode,omitempty"` - Res *types.EnterLockdownModeResponse `xml:"urn:vim25 EnterLockdownModeResponse,omitempty"` + Res *types.EnterLockdownModeResponse `xml:"EnterLockdownModeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4765,7 +5245,7 @@ func EnterLockdownMode(ctx context.Context, r soap.RoundTripper, req *types.Ente type EnterMaintenanceMode_TaskBody struct { Req *types.EnterMaintenanceMode_Task `xml:"urn:vim25 EnterMaintenanceMode_Task,omitempty"` - Res *types.EnterMaintenanceMode_TaskResponse `xml:"urn:vim25 EnterMaintenanceMode_TaskResponse,omitempty"` + Res *types.EnterMaintenanceMode_TaskResponse `xml:"EnterMaintenanceMode_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4785,7 +5265,7 @@ func EnterMaintenanceMode_Task(ctx context.Context, r soap.RoundTripper, req *ty type EstimateDatabaseSizeBody struct { Req *types.EstimateDatabaseSize `xml:"urn:vim25 EstimateDatabaseSize,omitempty"` - Res *types.EstimateDatabaseSizeResponse `xml:"urn:vim25 EstimateDatabaseSizeResponse,omitempty"` + Res *types.EstimateDatabaseSizeResponse `xml:"EstimateDatabaseSizeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4805,7 +5285,7 @@ func EstimateDatabaseSize(ctx context.Context, r soap.RoundTripper, req *types.E type EstimateStorageForConsolidateSnapshots_TaskBody struct { Req *types.EstimateStorageForConsolidateSnapshots_Task `xml:"urn:vim25 EstimateStorageForConsolidateSnapshots_Task,omitempty"` - Res *types.EstimateStorageForConsolidateSnapshots_TaskResponse `xml:"urn:vim25 EstimateStorageForConsolidateSnapshots_TaskResponse,omitempty"` + Res *types.EstimateStorageForConsolidateSnapshots_TaskResponse `xml:"EstimateStorageForConsolidateSnapshots_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4825,7 +5305,7 @@ func EstimateStorageForConsolidateSnapshots_Task(ctx context.Context, r soap.Rou type EsxAgentHostManagerUpdateConfigBody struct { Req *types.EsxAgentHostManagerUpdateConfig `xml:"urn:vim25 EsxAgentHostManagerUpdateConfig,omitempty"` - Res *types.EsxAgentHostManagerUpdateConfigResponse `xml:"urn:vim25 EsxAgentHostManagerUpdateConfigResponse,omitempty"` + Res *types.EsxAgentHostManagerUpdateConfigResponse `xml:"EsxAgentHostManagerUpdateConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4845,7 +5325,7 @@ func EsxAgentHostManagerUpdateConfig(ctx context.Context, r soap.RoundTripper, r type EvacuateVsanNode_TaskBody struct { Req *types.EvacuateVsanNode_Task `xml:"urn:vim25 EvacuateVsanNode_Task,omitempty"` - Res *types.EvacuateVsanNode_TaskResponse `xml:"urn:vim25 EvacuateVsanNode_TaskResponse,omitempty"` + Res *types.EvacuateVsanNode_TaskResponse `xml:"EvacuateVsanNode_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4865,7 +5345,7 @@ func EvacuateVsanNode_Task(ctx context.Context, r soap.RoundTripper, req *types. type EvcManagerBody struct { Req *types.EvcManager `xml:"urn:vim25 EvcManager,omitempty"` - Res *types.EvcManagerResponse `xml:"urn:vim25 EvcManagerResponse,omitempty"` + Res *types.EvcManagerResponse `xml:"EvcManagerResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4885,7 +5365,7 @@ func EvcManager(ctx context.Context, r soap.RoundTripper, req *types.EvcManager) type ExecuteHostProfileBody struct { Req *types.ExecuteHostProfile `xml:"urn:vim25 ExecuteHostProfile,omitempty"` - Res *types.ExecuteHostProfileResponse `xml:"urn:vim25 ExecuteHostProfileResponse,omitempty"` + Res *types.ExecuteHostProfileResponse `xml:"ExecuteHostProfileResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4905,7 +5385,7 @@ func ExecuteHostProfile(ctx context.Context, r soap.RoundTripper, req *types.Exe type ExecuteSimpleCommandBody struct { Req *types.ExecuteSimpleCommand `xml:"urn:vim25 ExecuteSimpleCommand,omitempty"` - Res *types.ExecuteSimpleCommandResponse `xml:"urn:vim25 ExecuteSimpleCommandResponse,omitempty"` + Res *types.ExecuteSimpleCommandResponse `xml:"ExecuteSimpleCommandResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4925,7 +5405,7 @@ func ExecuteSimpleCommand(ctx context.Context, r soap.RoundTripper, req *types.E type ExitLockdownModeBody struct { Req *types.ExitLockdownMode `xml:"urn:vim25 ExitLockdownMode,omitempty"` - Res *types.ExitLockdownModeResponse `xml:"urn:vim25 ExitLockdownModeResponse,omitempty"` + Res *types.ExitLockdownModeResponse `xml:"ExitLockdownModeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4945,7 +5425,7 @@ func ExitLockdownMode(ctx context.Context, r soap.RoundTripper, req *types.ExitL type ExitMaintenanceMode_TaskBody struct { Req *types.ExitMaintenanceMode_Task `xml:"urn:vim25 ExitMaintenanceMode_Task,omitempty"` - Res *types.ExitMaintenanceMode_TaskResponse `xml:"urn:vim25 ExitMaintenanceMode_TaskResponse,omitempty"` + Res *types.ExitMaintenanceMode_TaskResponse `xml:"ExitMaintenanceMode_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4965,7 +5445,7 @@ func ExitMaintenanceMode_Task(ctx context.Context, r soap.RoundTripper, req *typ type ExpandVmfsDatastoreBody struct { Req *types.ExpandVmfsDatastore `xml:"urn:vim25 ExpandVmfsDatastore,omitempty"` - Res *types.ExpandVmfsDatastoreResponse `xml:"urn:vim25 ExpandVmfsDatastoreResponse,omitempty"` + Res *types.ExpandVmfsDatastoreResponse `xml:"ExpandVmfsDatastoreResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -4985,7 +5465,7 @@ func ExpandVmfsDatastore(ctx context.Context, r soap.RoundTripper, req *types.Ex type ExpandVmfsExtentBody struct { Req *types.ExpandVmfsExtent `xml:"urn:vim25 ExpandVmfsExtent,omitempty"` - Res *types.ExpandVmfsExtentResponse `xml:"urn:vim25 ExpandVmfsExtentResponse,omitempty"` + Res *types.ExpandVmfsExtentResponse `xml:"ExpandVmfsExtentResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5005,7 +5485,7 @@ func ExpandVmfsExtent(ctx context.Context, r soap.RoundTripper, req *types.Expan type ExportAnswerFile_TaskBody struct { Req *types.ExportAnswerFile_Task `xml:"urn:vim25 ExportAnswerFile_Task,omitempty"` - Res *types.ExportAnswerFile_TaskResponse `xml:"urn:vim25 ExportAnswerFile_TaskResponse,omitempty"` + Res *types.ExportAnswerFile_TaskResponse `xml:"ExportAnswerFile_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5025,7 +5505,7 @@ func ExportAnswerFile_Task(ctx context.Context, r soap.RoundTripper, req *types. type ExportProfileBody struct { Req *types.ExportProfile `xml:"urn:vim25 ExportProfile,omitempty"` - Res *types.ExportProfileResponse `xml:"urn:vim25 ExportProfileResponse,omitempty"` + Res *types.ExportProfileResponse `xml:"ExportProfileResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5045,7 +5525,7 @@ func ExportProfile(ctx context.Context, r soap.RoundTripper, req *types.ExportPr type ExportSnapshotBody struct { Req *types.ExportSnapshot `xml:"urn:vim25 ExportSnapshot,omitempty"` - Res *types.ExportSnapshotResponse `xml:"urn:vim25 ExportSnapshotResponse,omitempty"` + Res *types.ExportSnapshotResponse `xml:"ExportSnapshotResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5065,7 +5545,7 @@ func ExportSnapshot(ctx context.Context, r soap.RoundTripper, req *types.ExportS type ExportVAppBody struct { Req *types.ExportVApp `xml:"urn:vim25 ExportVApp,omitempty"` - Res *types.ExportVAppResponse `xml:"urn:vim25 ExportVAppResponse,omitempty"` + Res *types.ExportVAppResponse `xml:"ExportVAppResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5085,7 +5565,7 @@ func ExportVApp(ctx context.Context, r soap.RoundTripper, req *types.ExportVApp) type ExportVmBody struct { Req *types.ExportVm `xml:"urn:vim25 ExportVm,omitempty"` - Res *types.ExportVmResponse `xml:"urn:vim25 ExportVmResponse,omitempty"` + Res *types.ExportVmResponse `xml:"ExportVmResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5105,7 +5585,7 @@ func ExportVm(ctx context.Context, r soap.RoundTripper, req *types.ExportVm) (*t type ExtendDisk_TaskBody struct { Req *types.ExtendDisk_Task `xml:"urn:vim25 ExtendDisk_Task,omitempty"` - Res *types.ExtendDisk_TaskResponse `xml:"urn:vim25 ExtendDisk_TaskResponse,omitempty"` + Res *types.ExtendDisk_TaskResponse `xml:"ExtendDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5123,9 +5603,29 @@ func ExtendDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.Extend return resBody.Res, nil } +type ExtendHCI_TaskBody struct { + Req *types.ExtendHCI_Task `xml:"urn:vim25 ExtendHCI_Task,omitempty"` + Res *types.ExtendHCI_TaskResponse `xml:"ExtendHCI_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ExtendHCI_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func ExtendHCI_Task(ctx context.Context, r soap.RoundTripper, req *types.ExtendHCI_Task) (*types.ExtendHCI_TaskResponse, error) { + var reqBody, resBody ExtendHCI_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type ExtendVffsBody struct { Req *types.ExtendVffs `xml:"urn:vim25 ExtendVffs,omitempty"` - Res *types.ExtendVffsResponse `xml:"urn:vim25 ExtendVffsResponse,omitempty"` + Res *types.ExtendVffsResponse `xml:"ExtendVffsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5145,7 +5645,7 @@ func ExtendVffs(ctx context.Context, r soap.RoundTripper, req *types.ExtendVffs) type ExtendVirtualDisk_TaskBody struct { Req *types.ExtendVirtualDisk_Task `xml:"urn:vim25 ExtendVirtualDisk_Task,omitempty"` - Res *types.ExtendVirtualDisk_TaskResponse `xml:"urn:vim25 ExtendVirtualDisk_TaskResponse,omitempty"` + Res *types.ExtendVirtualDisk_TaskResponse `xml:"ExtendVirtualDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5165,7 +5665,7 @@ func ExtendVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types type ExtendVmfsDatastoreBody struct { Req *types.ExtendVmfsDatastore `xml:"urn:vim25 ExtendVmfsDatastore,omitempty"` - Res *types.ExtendVmfsDatastoreResponse `xml:"urn:vim25 ExtendVmfsDatastoreResponse,omitempty"` + Res *types.ExtendVmfsDatastoreResponse `xml:"ExtendVmfsDatastoreResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5185,7 +5685,7 @@ func ExtendVmfsDatastore(ctx context.Context, r soap.RoundTripper, req *types.Ex type ExtractOvfEnvironmentBody struct { Req *types.ExtractOvfEnvironment `xml:"urn:vim25 ExtractOvfEnvironment,omitempty"` - Res *types.ExtractOvfEnvironmentResponse `xml:"urn:vim25 ExtractOvfEnvironmentResponse,omitempty"` + Res *types.ExtractOvfEnvironmentResponse `xml:"ExtractOvfEnvironmentResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5203,9 +5703,29 @@ func ExtractOvfEnvironment(ctx context.Context, r soap.RoundTripper, req *types. return resBody.Res, nil } +type FetchAuditRecordsBody struct { + Req *types.FetchAuditRecords `xml:"urn:vim25 FetchAuditRecords,omitempty"` + Res *types.FetchAuditRecordsResponse `xml:"FetchAuditRecordsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *FetchAuditRecordsBody) Fault() *soap.Fault { return b.Fault_ } + +func FetchAuditRecords(ctx context.Context, r soap.RoundTripper, req *types.FetchAuditRecords) (*types.FetchAuditRecordsResponse, error) { + var reqBody, resBody FetchAuditRecordsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type FetchDVPortKeysBody struct { Req *types.FetchDVPortKeys `xml:"urn:vim25 FetchDVPortKeys,omitempty"` - Res *types.FetchDVPortKeysResponse `xml:"urn:vim25 FetchDVPortKeysResponse,omitempty"` + Res *types.FetchDVPortKeysResponse `xml:"FetchDVPortKeysResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5225,7 +5745,7 @@ func FetchDVPortKeys(ctx context.Context, r soap.RoundTripper, req *types.FetchD type FetchDVPortsBody struct { Req *types.FetchDVPorts `xml:"urn:vim25 FetchDVPorts,omitempty"` - Res *types.FetchDVPortsResponse `xml:"urn:vim25 FetchDVPortsResponse,omitempty"` + Res *types.FetchDVPortsResponse `xml:"FetchDVPortsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5245,7 +5765,7 @@ func FetchDVPorts(ctx context.Context, r soap.RoundTripper, req *types.FetchDVPo type FetchSystemEventLogBody struct { Req *types.FetchSystemEventLog `xml:"urn:vim25 FetchSystemEventLog,omitempty"` - Res *types.FetchSystemEventLogResponse `xml:"urn:vim25 FetchSystemEventLogResponse,omitempty"` + Res *types.FetchSystemEventLogResponse `xml:"FetchSystemEventLogResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5265,7 +5785,7 @@ func FetchSystemEventLog(ctx context.Context, r soap.RoundTripper, req *types.Fe type FetchUserPrivilegeOnEntitiesBody struct { Req *types.FetchUserPrivilegeOnEntities `xml:"urn:vim25 FetchUserPrivilegeOnEntities,omitempty"` - Res *types.FetchUserPrivilegeOnEntitiesResponse `xml:"urn:vim25 FetchUserPrivilegeOnEntitiesResponse,omitempty"` + Res *types.FetchUserPrivilegeOnEntitiesResponse `xml:"FetchUserPrivilegeOnEntitiesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5285,7 +5805,7 @@ func FetchUserPrivilegeOnEntities(ctx context.Context, r soap.RoundTripper, req type FindAllByDnsNameBody struct { Req *types.FindAllByDnsName `xml:"urn:vim25 FindAllByDnsName,omitempty"` - Res *types.FindAllByDnsNameResponse `xml:"urn:vim25 FindAllByDnsNameResponse,omitempty"` + Res *types.FindAllByDnsNameResponse `xml:"FindAllByDnsNameResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5305,7 +5825,7 @@ func FindAllByDnsName(ctx context.Context, r soap.RoundTripper, req *types.FindA type FindAllByIpBody struct { Req *types.FindAllByIp `xml:"urn:vim25 FindAllByIp,omitempty"` - Res *types.FindAllByIpResponse `xml:"urn:vim25 FindAllByIpResponse,omitempty"` + Res *types.FindAllByIpResponse `xml:"FindAllByIpResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5325,7 +5845,7 @@ func FindAllByIp(ctx context.Context, r soap.RoundTripper, req *types.FindAllByI type FindAllByUuidBody struct { Req *types.FindAllByUuid `xml:"urn:vim25 FindAllByUuid,omitempty"` - Res *types.FindAllByUuidResponse `xml:"urn:vim25 FindAllByUuidResponse,omitempty"` + Res *types.FindAllByUuidResponse `xml:"FindAllByUuidResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5345,7 +5865,7 @@ func FindAllByUuid(ctx context.Context, r soap.RoundTripper, req *types.FindAllB type FindAssociatedProfileBody struct { Req *types.FindAssociatedProfile `xml:"urn:vim25 FindAssociatedProfile,omitempty"` - Res *types.FindAssociatedProfileResponse `xml:"urn:vim25 FindAssociatedProfileResponse,omitempty"` + Res *types.FindAssociatedProfileResponse `xml:"FindAssociatedProfileResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5365,7 +5885,7 @@ func FindAssociatedProfile(ctx context.Context, r soap.RoundTripper, req *types. type FindByDatastorePathBody struct { Req *types.FindByDatastorePath `xml:"urn:vim25 FindByDatastorePath,omitempty"` - Res *types.FindByDatastorePathResponse `xml:"urn:vim25 FindByDatastorePathResponse,omitempty"` + Res *types.FindByDatastorePathResponse `xml:"FindByDatastorePathResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5385,7 +5905,7 @@ func FindByDatastorePath(ctx context.Context, r soap.RoundTripper, req *types.Fi type FindByDnsNameBody struct { Req *types.FindByDnsName `xml:"urn:vim25 FindByDnsName,omitempty"` - Res *types.FindByDnsNameResponse `xml:"urn:vim25 FindByDnsNameResponse,omitempty"` + Res *types.FindByDnsNameResponse `xml:"FindByDnsNameResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5405,7 +5925,7 @@ func FindByDnsName(ctx context.Context, r soap.RoundTripper, req *types.FindByDn type FindByInventoryPathBody struct { Req *types.FindByInventoryPath `xml:"urn:vim25 FindByInventoryPath,omitempty"` - Res *types.FindByInventoryPathResponse `xml:"urn:vim25 FindByInventoryPathResponse,omitempty"` + Res *types.FindByInventoryPathResponse `xml:"FindByInventoryPathResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5425,7 +5945,7 @@ func FindByInventoryPath(ctx context.Context, r soap.RoundTripper, req *types.Fi type FindByIpBody struct { Req *types.FindByIp `xml:"urn:vim25 FindByIp,omitempty"` - Res *types.FindByIpResponse `xml:"urn:vim25 FindByIpResponse,omitempty"` + Res *types.FindByIpResponse `xml:"FindByIpResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5445,7 +5965,7 @@ func FindByIp(ctx context.Context, r soap.RoundTripper, req *types.FindByIp) (*t type FindByUuidBody struct { Req *types.FindByUuid `xml:"urn:vim25 FindByUuid,omitempty"` - Res *types.FindByUuidResponse `xml:"urn:vim25 FindByUuidResponse,omitempty"` + Res *types.FindByUuidResponse `xml:"FindByUuidResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5465,7 +5985,7 @@ func FindByUuid(ctx context.Context, r soap.RoundTripper, req *types.FindByUuid) type FindChildBody struct { Req *types.FindChild `xml:"urn:vim25 FindChild,omitempty"` - Res *types.FindChildResponse `xml:"urn:vim25 FindChildResponse,omitempty"` + Res *types.FindChildResponse `xml:"FindChildResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5485,7 +6005,7 @@ func FindChild(ctx context.Context, r soap.RoundTripper, req *types.FindChild) ( type FindExtensionBody struct { Req *types.FindExtension `xml:"urn:vim25 FindExtension,omitempty"` - Res *types.FindExtensionResponse `xml:"urn:vim25 FindExtensionResponse,omitempty"` + Res *types.FindExtensionResponse `xml:"FindExtensionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5505,7 +6025,7 @@ func FindExtension(ctx context.Context, r soap.RoundTripper, req *types.FindExte type FindRulesForVmBody struct { Req *types.FindRulesForVm `xml:"urn:vim25 FindRulesForVm,omitempty"` - Res *types.FindRulesForVmResponse `xml:"urn:vim25 FindRulesForVmResponse,omitempty"` + Res *types.FindRulesForVmResponse `xml:"FindRulesForVmResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5525,7 +6045,7 @@ func FindRulesForVm(ctx context.Context, r soap.RoundTripper, req *types.FindRul type FormatVffsBody struct { Req *types.FormatVffs `xml:"urn:vim25 FormatVffs,omitempty"` - Res *types.FormatVffsResponse `xml:"urn:vim25 FormatVffsResponse,omitempty"` + Res *types.FormatVffsResponse `xml:"FormatVffsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5545,7 +6065,7 @@ func FormatVffs(ctx context.Context, r soap.RoundTripper, req *types.FormatVffs) type FormatVmfsBody struct { Req *types.FormatVmfs `xml:"urn:vim25 FormatVmfs,omitempty"` - Res *types.FormatVmfsResponse `xml:"urn:vim25 FormatVmfsResponse,omitempty"` + Res *types.FormatVmfsResponse `xml:"FormatVmfsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5565,7 +6085,7 @@ func FormatVmfs(ctx context.Context, r soap.RoundTripper, req *types.FormatVmfs) type GenerateCertificateSigningRequestBody struct { Req *types.GenerateCertificateSigningRequest `xml:"urn:vim25 GenerateCertificateSigningRequest,omitempty"` - Res *types.GenerateCertificateSigningRequestResponse `xml:"urn:vim25 GenerateCertificateSigningRequestResponse,omitempty"` + Res *types.GenerateCertificateSigningRequestResponse `xml:"GenerateCertificateSigningRequestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5585,7 +6105,7 @@ func GenerateCertificateSigningRequest(ctx context.Context, r soap.RoundTripper, type GenerateCertificateSigningRequestByDnBody struct { Req *types.GenerateCertificateSigningRequestByDn `xml:"urn:vim25 GenerateCertificateSigningRequestByDn,omitempty"` - Res *types.GenerateCertificateSigningRequestByDnResponse `xml:"urn:vim25 GenerateCertificateSigningRequestByDnResponse,omitempty"` + Res *types.GenerateCertificateSigningRequestByDnResponse `xml:"GenerateCertificateSigningRequestByDnResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5605,7 +6125,7 @@ func GenerateCertificateSigningRequestByDn(ctx context.Context, r soap.RoundTrip type GenerateClientCsrBody struct { Req *types.GenerateClientCsr `xml:"urn:vim25 GenerateClientCsr,omitempty"` - Res *types.GenerateClientCsrResponse `xml:"urn:vim25 GenerateClientCsrResponse,omitempty"` + Res *types.GenerateClientCsrResponse `xml:"GenerateClientCsrResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5625,7 +6145,7 @@ func GenerateClientCsr(ctx context.Context, r soap.RoundTripper, req *types.Gene type GenerateConfigTaskListBody struct { Req *types.GenerateConfigTaskList `xml:"urn:vim25 GenerateConfigTaskList,omitempty"` - Res *types.GenerateConfigTaskListResponse `xml:"urn:vim25 GenerateConfigTaskListResponse,omitempty"` + Res *types.GenerateConfigTaskListResponse `xml:"GenerateConfigTaskListResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5645,7 +6165,7 @@ func GenerateConfigTaskList(ctx context.Context, r soap.RoundTripper, req *types type GenerateHostConfigTaskSpec_TaskBody struct { Req *types.GenerateHostConfigTaskSpec_Task `xml:"urn:vim25 GenerateHostConfigTaskSpec_Task,omitempty"` - Res *types.GenerateHostConfigTaskSpec_TaskResponse `xml:"urn:vim25 GenerateHostConfigTaskSpec_TaskResponse,omitempty"` + Res *types.GenerateHostConfigTaskSpec_TaskResponse `xml:"GenerateHostConfigTaskSpec_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5665,7 +6185,7 @@ func GenerateHostConfigTaskSpec_Task(ctx context.Context, r soap.RoundTripper, r type GenerateHostProfileTaskList_TaskBody struct { Req *types.GenerateHostProfileTaskList_Task `xml:"urn:vim25 GenerateHostProfileTaskList_Task,omitempty"` - Res *types.GenerateHostProfileTaskList_TaskResponse `xml:"urn:vim25 GenerateHostProfileTaskList_TaskResponse,omitempty"` + Res *types.GenerateHostProfileTaskList_TaskResponse `xml:"GenerateHostProfileTaskList_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5685,7 +6205,7 @@ func GenerateHostProfileTaskList_Task(ctx context.Context, r soap.RoundTripper, type GenerateKeyBody struct { Req *types.GenerateKey `xml:"urn:vim25 GenerateKey,omitempty"` - Res *types.GenerateKeyResponse `xml:"urn:vim25 GenerateKeyResponse,omitempty"` + Res *types.GenerateKeyResponse `xml:"GenerateKeyResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5705,7 +6225,7 @@ func GenerateKey(ctx context.Context, r soap.RoundTripper, req *types.GenerateKe type GenerateLogBundles_TaskBody struct { Req *types.GenerateLogBundles_Task `xml:"urn:vim25 GenerateLogBundles_Task,omitempty"` - Res *types.GenerateLogBundles_TaskResponse `xml:"urn:vim25 GenerateLogBundles_TaskResponse,omitempty"` + Res *types.GenerateLogBundles_TaskResponse `xml:"GenerateLogBundles_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5725,7 +6245,7 @@ func GenerateLogBundles_Task(ctx context.Context, r soap.RoundTripper, req *type type GenerateSelfSignedClientCertBody struct { Req *types.GenerateSelfSignedClientCert `xml:"urn:vim25 GenerateSelfSignedClientCert,omitempty"` - Res *types.GenerateSelfSignedClientCertResponse `xml:"urn:vim25 GenerateSelfSignedClientCertResponse,omitempty"` + Res *types.GenerateSelfSignedClientCertResponse `xml:"GenerateSelfSignedClientCertResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5745,7 +6265,7 @@ func GenerateSelfSignedClientCert(ctx context.Context, r soap.RoundTripper, req type GetAlarmBody struct { Req *types.GetAlarm `xml:"urn:vim25 GetAlarm,omitempty"` - Res *types.GetAlarmResponse `xml:"urn:vim25 GetAlarmResponse,omitempty"` + Res *types.GetAlarmResponse `xml:"GetAlarmResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5765,7 +6285,7 @@ func GetAlarm(ctx context.Context, r soap.RoundTripper, req *types.GetAlarm) (*t type GetAlarmStateBody struct { Req *types.GetAlarmState `xml:"urn:vim25 GetAlarmState,omitempty"` - Res *types.GetAlarmStateResponse `xml:"urn:vim25 GetAlarmStateResponse,omitempty"` + Res *types.GetAlarmStateResponse `xml:"GetAlarmStateResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5785,7 +6305,7 @@ func GetAlarmState(ctx context.Context, r soap.RoundTripper, req *types.GetAlarm type GetCustomizationSpecBody struct { Req *types.GetCustomizationSpec `xml:"urn:vim25 GetCustomizationSpec,omitempty"` - Res *types.GetCustomizationSpecResponse `xml:"urn:vim25 GetCustomizationSpecResponse,omitempty"` + Res *types.GetCustomizationSpecResponse `xml:"GetCustomizationSpecResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5803,9 +6323,29 @@ func GetCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *types.G return resBody.Res, nil } +type GetDefaultKmsClusterBody struct { + Req *types.GetDefaultKmsCluster `xml:"urn:vim25 GetDefaultKmsCluster,omitempty"` + Res *types.GetDefaultKmsClusterResponse `xml:"GetDefaultKmsClusterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *GetDefaultKmsClusterBody) Fault() *soap.Fault { return b.Fault_ } + +func GetDefaultKmsCluster(ctx context.Context, r soap.RoundTripper, req *types.GetDefaultKmsCluster) (*types.GetDefaultKmsClusterResponse, error) { + var reqBody, resBody GetDefaultKmsClusterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type GetPublicKeyBody struct { Req *types.GetPublicKey `xml:"urn:vim25 GetPublicKey,omitempty"` - Res *types.GetPublicKeyResponse `xml:"urn:vim25 GetPublicKeyResponse,omitempty"` + Res *types.GetPublicKeyResponse `xml:"GetPublicKeyResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5825,7 +6365,7 @@ func GetPublicKey(ctx context.Context, r soap.RoundTripper, req *types.GetPublic type GetResourceUsageBody struct { Req *types.GetResourceUsage `xml:"urn:vim25 GetResourceUsage,omitempty"` - Res *types.GetResourceUsageResponse `xml:"urn:vim25 GetResourceUsageResponse,omitempty"` + Res *types.GetResourceUsageResponse `xml:"GetResourceUsageResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5843,9 +6383,49 @@ func GetResourceUsage(ctx context.Context, r soap.RoundTripper, req *types.GetRe return resBody.Res, nil } +type GetSiteInfoBody struct { + Req *types.GetSiteInfo `xml:"urn:vim25 GetSiteInfo,omitempty"` + Res *types.GetSiteInfoResponse `xml:"GetSiteInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *GetSiteInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func GetSiteInfo(ctx context.Context, r soap.RoundTripper, req *types.GetSiteInfo) (*types.GetSiteInfoResponse, error) { + var reqBody, resBody GetSiteInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type GetSystemVMsRestrictedDatastoresBody struct { + Req *types.GetSystemVMsRestrictedDatastores `xml:"urn:vim25 GetSystemVMsRestrictedDatastores,omitempty"` + Res *types.GetSystemVMsRestrictedDatastoresResponse `xml:"GetSystemVMsRestrictedDatastoresResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *GetSystemVMsRestrictedDatastoresBody) Fault() *soap.Fault { return b.Fault_ } + +func GetSystemVMsRestrictedDatastores(ctx context.Context, r soap.RoundTripper, req *types.GetSystemVMsRestrictedDatastores) (*types.GetSystemVMsRestrictedDatastoresResponse, error) { + var reqBody, resBody GetSystemVMsRestrictedDatastoresBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type GetVchaClusterHealthBody struct { Req *types.GetVchaClusterHealth `xml:"urn:vim25 GetVchaClusterHealth,omitempty"` - Res *types.GetVchaClusterHealthResponse `xml:"urn:vim25 GetVchaClusterHealthResponse,omitempty"` + Res *types.GetVchaClusterHealthResponse `xml:"GetVchaClusterHealthResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5865,7 +6445,7 @@ func GetVchaClusterHealth(ctx context.Context, r soap.RoundTripper, req *types.G type GetVsanObjExtAttrsBody struct { Req *types.GetVsanObjExtAttrs `xml:"urn:vim25 GetVsanObjExtAttrs,omitempty"` - Res *types.GetVsanObjExtAttrsResponse `xml:"urn:vim25 GetVsanObjExtAttrsResponse,omitempty"` + Res *types.GetVsanObjExtAttrsResponse `xml:"GetVsanObjExtAttrsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5885,7 +6465,7 @@ func GetVsanObjExtAttrs(ctx context.Context, r soap.RoundTripper, req *types.Get type HasMonitoredEntityBody struct { Req *types.HasMonitoredEntity `xml:"urn:vim25 HasMonitoredEntity,omitempty"` - Res *types.HasMonitoredEntityResponse `xml:"urn:vim25 HasMonitoredEntityResponse,omitempty"` + Res *types.HasMonitoredEntityResponse `xml:"HasMonitoredEntityResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5905,7 +6485,7 @@ func HasMonitoredEntity(ctx context.Context, r soap.RoundTripper, req *types.Has type HasPrivilegeOnEntitiesBody struct { Req *types.HasPrivilegeOnEntities `xml:"urn:vim25 HasPrivilegeOnEntities,omitempty"` - Res *types.HasPrivilegeOnEntitiesResponse `xml:"urn:vim25 HasPrivilegeOnEntitiesResponse,omitempty"` + Res *types.HasPrivilegeOnEntitiesResponse `xml:"HasPrivilegeOnEntitiesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5925,7 +6505,7 @@ func HasPrivilegeOnEntities(ctx context.Context, r soap.RoundTripper, req *types type HasPrivilegeOnEntityBody struct { Req *types.HasPrivilegeOnEntity `xml:"urn:vim25 HasPrivilegeOnEntity,omitempty"` - Res *types.HasPrivilegeOnEntityResponse `xml:"urn:vim25 HasPrivilegeOnEntityResponse,omitempty"` + Res *types.HasPrivilegeOnEntityResponse `xml:"HasPrivilegeOnEntityResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5945,7 +6525,7 @@ func HasPrivilegeOnEntity(ctx context.Context, r soap.RoundTripper, req *types.H type HasProviderBody struct { Req *types.HasProvider `xml:"urn:vim25 HasProvider,omitempty"` - Res *types.HasProviderResponse `xml:"urn:vim25 HasProviderResponse,omitempty"` + Res *types.HasProviderResponse `xml:"HasProviderResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5965,7 +6545,7 @@ func HasProvider(ctx context.Context, r soap.RoundTripper, req *types.HasProvide type HasUserPrivilegeOnEntitiesBody struct { Req *types.HasUserPrivilegeOnEntities `xml:"urn:vim25 HasUserPrivilegeOnEntities,omitempty"` - Res *types.HasUserPrivilegeOnEntitiesResponse `xml:"urn:vim25 HasUserPrivilegeOnEntitiesResponse,omitempty"` + Res *types.HasUserPrivilegeOnEntitiesResponse `xml:"HasUserPrivilegeOnEntitiesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -5985,7 +6565,7 @@ func HasUserPrivilegeOnEntities(ctx context.Context, r soap.RoundTripper, req *t type HostClearVStorageObjectControlFlagsBody struct { Req *types.HostClearVStorageObjectControlFlags `xml:"urn:vim25 HostClearVStorageObjectControlFlags,omitempty"` - Res *types.HostClearVStorageObjectControlFlagsResponse `xml:"urn:vim25 HostClearVStorageObjectControlFlagsResponse,omitempty"` + Res *types.HostClearVStorageObjectControlFlagsResponse `xml:"HostClearVStorageObjectControlFlagsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6005,7 +6585,7 @@ func HostClearVStorageObjectControlFlags(ctx context.Context, r soap.RoundTrippe type HostCloneVStorageObject_TaskBody struct { Req *types.HostCloneVStorageObject_Task `xml:"urn:vim25 HostCloneVStorageObject_Task,omitempty"` - Res *types.HostCloneVStorageObject_TaskResponse `xml:"urn:vim25 HostCloneVStorageObject_TaskResponse,omitempty"` + Res *types.HostCloneVStorageObject_TaskResponse `xml:"HostCloneVStorageObject_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6025,7 +6605,7 @@ func HostCloneVStorageObject_Task(ctx context.Context, r soap.RoundTripper, req type HostConfigVFlashCacheBody struct { Req *types.HostConfigVFlashCache `xml:"urn:vim25 HostConfigVFlashCache,omitempty"` - Res *types.HostConfigVFlashCacheResponse `xml:"urn:vim25 HostConfigVFlashCacheResponse,omitempty"` + Res *types.HostConfigVFlashCacheResponse `xml:"HostConfigVFlashCacheResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6045,7 +6625,7 @@ func HostConfigVFlashCache(ctx context.Context, r soap.RoundTripper, req *types. type HostConfigureVFlashResourceBody struct { Req *types.HostConfigureVFlashResource `xml:"urn:vim25 HostConfigureVFlashResource,omitempty"` - Res *types.HostConfigureVFlashResourceResponse `xml:"urn:vim25 HostConfigureVFlashResourceResponse,omitempty"` + Res *types.HostConfigureVFlashResourceResponse `xml:"HostConfigureVFlashResourceResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6065,7 +6645,7 @@ func HostConfigureVFlashResource(ctx context.Context, r soap.RoundTripper, req * type HostCreateDisk_TaskBody struct { Req *types.HostCreateDisk_Task `xml:"urn:vim25 HostCreateDisk_Task,omitempty"` - Res *types.HostCreateDisk_TaskResponse `xml:"urn:vim25 HostCreateDisk_TaskResponse,omitempty"` + Res *types.HostCreateDisk_TaskResponse `xml:"HostCreateDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6083,9 +6663,29 @@ 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:"urn:vim25 HostDeleteVStorageObject_TaskResponse,omitempty"` + Res *types.HostDeleteVStorageObject_TaskResponse `xml:"HostDeleteVStorageObject_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6105,7 +6705,7 @@ func HostDeleteVStorageObject_Task(ctx context.Context, r soap.RoundTripper, req type HostExtendDisk_TaskBody struct { Req *types.HostExtendDisk_Task `xml:"urn:vim25 HostExtendDisk_Task,omitempty"` - Res *types.HostExtendDisk_TaskResponse `xml:"urn:vim25 HostExtendDisk_TaskResponse,omitempty"` + Res *types.HostExtendDisk_TaskResponse `xml:"HostExtendDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6125,7 +6725,7 @@ func HostExtendDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.Ho type HostGetVFlashModuleDefaultConfigBody struct { Req *types.HostGetVFlashModuleDefaultConfig `xml:"urn:vim25 HostGetVFlashModuleDefaultConfig,omitempty"` - Res *types.HostGetVFlashModuleDefaultConfigResponse `xml:"urn:vim25 HostGetVFlashModuleDefaultConfigResponse,omitempty"` + Res *types.HostGetVFlashModuleDefaultConfigResponse `xml:"HostGetVFlashModuleDefaultConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6145,7 +6745,7 @@ func HostGetVFlashModuleDefaultConfig(ctx context.Context, r soap.RoundTripper, type HostImageConfigGetAcceptanceBody struct { Req *types.HostImageConfigGetAcceptance `xml:"urn:vim25 HostImageConfigGetAcceptance,omitempty"` - Res *types.HostImageConfigGetAcceptanceResponse `xml:"urn:vim25 HostImageConfigGetAcceptanceResponse,omitempty"` + Res *types.HostImageConfigGetAcceptanceResponse `xml:"HostImageConfigGetAcceptanceResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6165,7 +6765,7 @@ func HostImageConfigGetAcceptance(ctx context.Context, r soap.RoundTripper, req type HostImageConfigGetProfileBody struct { Req *types.HostImageConfigGetProfile `xml:"urn:vim25 HostImageConfigGetProfile,omitempty"` - Res *types.HostImageConfigGetProfileResponse `xml:"urn:vim25 HostImageConfigGetProfileResponse,omitempty"` + Res *types.HostImageConfigGetProfileResponse `xml:"HostImageConfigGetProfileResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6185,7 +6785,7 @@ func HostImageConfigGetProfile(ctx context.Context, r soap.RoundTripper, req *ty type HostInflateDisk_TaskBody struct { Req *types.HostInflateDisk_Task `xml:"urn:vim25 HostInflateDisk_Task,omitempty"` - Res *types.HostInflateDisk_TaskResponse `xml:"urn:vim25 HostInflateDisk_TaskResponse,omitempty"` + Res *types.HostInflateDisk_TaskResponse `xml:"HostInflateDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6205,7 +6805,7 @@ func HostInflateDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.H type HostListVStorageObjectBody struct { Req *types.HostListVStorageObject `xml:"urn:vim25 HostListVStorageObject,omitempty"` - Res *types.HostListVStorageObjectResponse `xml:"urn:vim25 HostListVStorageObjectResponse,omitempty"` + Res *types.HostListVStorageObjectResponse `xml:"HostListVStorageObjectResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6225,7 +6825,7 @@ func HostListVStorageObject(ctx context.Context, r soap.RoundTripper, req *types type HostProfileResetValidationStateBody struct { Req *types.HostProfileResetValidationState `xml:"urn:vim25 HostProfileResetValidationState,omitempty"` - Res *types.HostProfileResetValidationStateResponse `xml:"urn:vim25 HostProfileResetValidationStateResponse,omitempty"` + Res *types.HostProfileResetValidationStateResponse `xml:"HostProfileResetValidationStateResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6245,7 +6845,7 @@ func HostProfileResetValidationState(ctx context.Context, r soap.RoundTripper, r type HostReconcileDatastoreInventory_TaskBody struct { Req *types.HostReconcileDatastoreInventory_Task `xml:"urn:vim25 HostReconcileDatastoreInventory_Task,omitempty"` - Res *types.HostReconcileDatastoreInventory_TaskResponse `xml:"urn:vim25 HostReconcileDatastoreInventory_TaskResponse,omitempty"` + Res *types.HostReconcileDatastoreInventory_TaskResponse `xml:"HostReconcileDatastoreInventory_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6265,7 +6865,7 @@ func HostReconcileDatastoreInventory_Task(ctx context.Context, r soap.RoundTripp type HostRegisterDiskBody struct { Req *types.HostRegisterDisk `xml:"urn:vim25 HostRegisterDisk,omitempty"` - Res *types.HostRegisterDiskResponse `xml:"urn:vim25 HostRegisterDiskResponse,omitempty"` + Res *types.HostRegisterDiskResponse `xml:"HostRegisterDiskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6285,7 +6885,7 @@ func HostRegisterDisk(ctx context.Context, r soap.RoundTripper, req *types.HostR type HostRelocateVStorageObject_TaskBody struct { Req *types.HostRelocateVStorageObject_Task `xml:"urn:vim25 HostRelocateVStorageObject_Task,omitempty"` - Res *types.HostRelocateVStorageObject_TaskResponse `xml:"urn:vim25 HostRelocateVStorageObject_TaskResponse,omitempty"` + Res *types.HostRelocateVStorageObject_TaskResponse `xml:"HostRelocateVStorageObject_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6305,7 +6905,7 @@ func HostRelocateVStorageObject_Task(ctx context.Context, r soap.RoundTripper, r type HostRemoveVFlashResourceBody struct { Req *types.HostRemoveVFlashResource `xml:"urn:vim25 HostRemoveVFlashResource,omitempty"` - Res *types.HostRemoveVFlashResourceResponse `xml:"urn:vim25 HostRemoveVFlashResourceResponse,omitempty"` + Res *types.HostRemoveVFlashResourceResponse `xml:"HostRemoveVFlashResourceResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6325,7 +6925,7 @@ func HostRemoveVFlashResource(ctx context.Context, r soap.RoundTripper, req *typ type HostRenameVStorageObjectBody struct { Req *types.HostRenameVStorageObject `xml:"urn:vim25 HostRenameVStorageObject,omitempty"` - Res *types.HostRenameVStorageObjectResponse `xml:"urn:vim25 HostRenameVStorageObjectResponse,omitempty"` + Res *types.HostRenameVStorageObjectResponse `xml:"HostRenameVStorageObjectResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6345,7 +6945,7 @@ func HostRenameVStorageObject(ctx context.Context, r soap.RoundTripper, req *typ type HostRetrieveVStorageInfrastructureObjectPolicyBody struct { Req *types.HostRetrieveVStorageInfrastructureObjectPolicy `xml:"urn:vim25 HostRetrieveVStorageInfrastructureObjectPolicy,omitempty"` - Res *types.HostRetrieveVStorageInfrastructureObjectPolicyResponse `xml:"urn:vim25 HostRetrieveVStorageInfrastructureObjectPolicyResponse,omitempty"` + Res *types.HostRetrieveVStorageInfrastructureObjectPolicyResponse `xml:"HostRetrieveVStorageInfrastructureObjectPolicyResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6365,7 +6965,7 @@ func HostRetrieveVStorageInfrastructureObjectPolicy(ctx context.Context, r soap. type HostRetrieveVStorageObjectBody struct { Req *types.HostRetrieveVStorageObject `xml:"urn:vim25 HostRetrieveVStorageObject,omitempty"` - Res *types.HostRetrieveVStorageObjectResponse `xml:"urn:vim25 HostRetrieveVStorageObjectResponse,omitempty"` + Res *types.HostRetrieveVStorageObjectResponse `xml:"HostRetrieveVStorageObjectResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6383,9 +6983,49 @@ func HostRetrieveVStorageObject(ctx context.Context, r soap.RoundTripper, req *t return resBody.Res, nil } +type HostRetrieveVStorageObjectMetadataBody struct { + Req *types.HostRetrieveVStorageObjectMetadata `xml:"urn:vim25 HostRetrieveVStorageObjectMetadata,omitempty"` + Res *types.HostRetrieveVStorageObjectMetadataResponse `xml:"HostRetrieveVStorageObjectMetadataResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HostRetrieveVStorageObjectMetadataBody) Fault() *soap.Fault { return b.Fault_ } + +func HostRetrieveVStorageObjectMetadata(ctx context.Context, r soap.RoundTripper, req *types.HostRetrieveVStorageObjectMetadata) (*types.HostRetrieveVStorageObjectMetadataResponse, error) { + var reqBody, resBody HostRetrieveVStorageObjectMetadataBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type HostRetrieveVStorageObjectMetadataValueBody struct { + Req *types.HostRetrieveVStorageObjectMetadataValue `xml:"urn:vim25 HostRetrieveVStorageObjectMetadataValue,omitempty"` + Res *types.HostRetrieveVStorageObjectMetadataValueResponse `xml:"HostRetrieveVStorageObjectMetadataValueResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HostRetrieveVStorageObjectMetadataValueBody) Fault() *soap.Fault { return b.Fault_ } + +func HostRetrieveVStorageObjectMetadataValue(ctx context.Context, r soap.RoundTripper, req *types.HostRetrieveVStorageObjectMetadataValue) (*types.HostRetrieveVStorageObjectMetadataValueResponse, error) { + var reqBody, resBody HostRetrieveVStorageObjectMetadataValueBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type HostRetrieveVStorageObjectStateBody struct { Req *types.HostRetrieveVStorageObjectState `xml:"urn:vim25 HostRetrieveVStorageObjectState,omitempty"` - Res *types.HostRetrieveVStorageObjectStateResponse `xml:"urn:vim25 HostRetrieveVStorageObjectStateResponse,omitempty"` + Res *types.HostRetrieveVStorageObjectStateResponse `xml:"HostRetrieveVStorageObjectStateResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6405,7 +7045,7 @@ func HostRetrieveVStorageObjectState(ctx context.Context, r soap.RoundTripper, r type HostScheduleReconcileDatastoreInventoryBody struct { Req *types.HostScheduleReconcileDatastoreInventory `xml:"urn:vim25 HostScheduleReconcileDatastoreInventory,omitempty"` - Res *types.HostScheduleReconcileDatastoreInventoryResponse `xml:"urn:vim25 HostScheduleReconcileDatastoreInventoryResponse,omitempty"` + Res *types.HostScheduleReconcileDatastoreInventoryResponse `xml:"HostScheduleReconcileDatastoreInventoryResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6425,7 +7065,7 @@ func HostScheduleReconcileDatastoreInventory(ctx context.Context, r soap.RoundTr type HostSetVStorageObjectControlFlagsBody struct { Req *types.HostSetVStorageObjectControlFlags `xml:"urn:vim25 HostSetVStorageObjectControlFlags,omitempty"` - Res *types.HostSetVStorageObjectControlFlagsResponse `xml:"urn:vim25 HostSetVStorageObjectControlFlagsResponse,omitempty"` + Res *types.HostSetVStorageObjectControlFlagsResponse `xml:"HostSetVStorageObjectControlFlagsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6445,7 +7085,7 @@ func HostSetVStorageObjectControlFlags(ctx context.Context, r soap.RoundTripper, type HostSpecGetUpdatedHostsBody struct { Req *types.HostSpecGetUpdatedHosts `xml:"urn:vim25 HostSpecGetUpdatedHosts,omitempty"` - Res *types.HostSpecGetUpdatedHostsResponse `xml:"urn:vim25 HostSpecGetUpdatedHostsResponse,omitempty"` + Res *types.HostSpecGetUpdatedHostsResponse `xml:"HostSpecGetUpdatedHostsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6463,9 +7103,49 @@ 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"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *HostUpdateVStorageObjectMetadata_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func HostUpdateVStorageObjectMetadata_Task(ctx context.Context, r soap.RoundTripper, req *types.HostUpdateVStorageObjectMetadata_Task) (*types.HostUpdateVStorageObjectMetadata_TaskResponse, error) { + var reqBody, resBody HostUpdateVStorageObjectMetadata_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type HostVStorageObjectCreateDiskFromSnapshot_TaskBody struct { Req *types.HostVStorageObjectCreateDiskFromSnapshot_Task `xml:"urn:vim25 HostVStorageObjectCreateDiskFromSnapshot_Task,omitempty"` - Res *types.HostVStorageObjectCreateDiskFromSnapshot_TaskResponse `xml:"urn:vim25 HostVStorageObjectCreateDiskFromSnapshot_TaskResponse,omitempty"` + Res *types.HostVStorageObjectCreateDiskFromSnapshot_TaskResponse `xml:"HostVStorageObjectCreateDiskFromSnapshot_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6485,7 +7165,7 @@ func HostVStorageObjectCreateDiskFromSnapshot_Task(ctx context.Context, r soap.R type HostVStorageObjectCreateSnapshot_TaskBody struct { Req *types.HostVStorageObjectCreateSnapshot_Task `xml:"urn:vim25 HostVStorageObjectCreateSnapshot_Task,omitempty"` - Res *types.HostVStorageObjectCreateSnapshot_TaskResponse `xml:"urn:vim25 HostVStorageObjectCreateSnapshot_TaskResponse,omitempty"` + Res *types.HostVStorageObjectCreateSnapshot_TaskResponse `xml:"HostVStorageObjectCreateSnapshot_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6505,7 +7185,7 @@ func HostVStorageObjectCreateSnapshot_Task(ctx context.Context, r soap.RoundTrip type HostVStorageObjectDeleteSnapshot_TaskBody struct { Req *types.HostVStorageObjectDeleteSnapshot_Task `xml:"urn:vim25 HostVStorageObjectDeleteSnapshot_Task,omitempty"` - Res *types.HostVStorageObjectDeleteSnapshot_TaskResponse `xml:"urn:vim25 HostVStorageObjectDeleteSnapshot_TaskResponse,omitempty"` + Res *types.HostVStorageObjectDeleteSnapshot_TaskResponse `xml:"HostVStorageObjectDeleteSnapshot_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6525,7 +7205,7 @@ func HostVStorageObjectDeleteSnapshot_Task(ctx context.Context, r soap.RoundTrip type HostVStorageObjectRetrieveSnapshotInfoBody struct { Req *types.HostVStorageObjectRetrieveSnapshotInfo `xml:"urn:vim25 HostVStorageObjectRetrieveSnapshotInfo,omitempty"` - Res *types.HostVStorageObjectRetrieveSnapshotInfoResponse `xml:"urn:vim25 HostVStorageObjectRetrieveSnapshotInfoResponse,omitempty"` + Res *types.HostVStorageObjectRetrieveSnapshotInfoResponse `xml:"HostVStorageObjectRetrieveSnapshotInfoResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6545,7 +7225,7 @@ func HostVStorageObjectRetrieveSnapshotInfo(ctx context.Context, r soap.RoundTri type HostVStorageObjectRevert_TaskBody struct { Req *types.HostVStorageObjectRevert_Task `xml:"urn:vim25 HostVStorageObjectRevert_Task,omitempty"` - Res *types.HostVStorageObjectRevert_TaskResponse `xml:"urn:vim25 HostVStorageObjectRevert_TaskResponse,omitempty"` + Res *types.HostVStorageObjectRevert_TaskResponse `xml:"HostVStorageObjectRevert_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6565,7 +7245,7 @@ func HostVStorageObjectRevert_Task(ctx context.Context, r soap.RoundTripper, req type HttpNfcLeaseAbortBody struct { Req *types.HttpNfcLeaseAbort `xml:"urn:vim25 HttpNfcLeaseAbort,omitempty"` - Res *types.HttpNfcLeaseAbortResponse `xml:"urn:vim25 HttpNfcLeaseAbortResponse,omitempty"` + Res *types.HttpNfcLeaseAbortResponse `xml:"HttpNfcLeaseAbortResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6585,7 +7265,7 @@ func HttpNfcLeaseAbort(ctx context.Context, r soap.RoundTripper, req *types.Http type HttpNfcLeaseCompleteBody struct { Req *types.HttpNfcLeaseComplete `xml:"urn:vim25 HttpNfcLeaseComplete,omitempty"` - Res *types.HttpNfcLeaseCompleteResponse `xml:"urn:vim25 HttpNfcLeaseCompleteResponse,omitempty"` + Res *types.HttpNfcLeaseCompleteResponse `xml:"HttpNfcLeaseCompleteResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6605,7 +7285,7 @@ func HttpNfcLeaseComplete(ctx context.Context, r soap.RoundTripper, req *types.H type HttpNfcLeaseGetManifestBody struct { Req *types.HttpNfcLeaseGetManifest `xml:"urn:vim25 HttpNfcLeaseGetManifest,omitempty"` - Res *types.HttpNfcLeaseGetManifestResponse `xml:"urn:vim25 HttpNfcLeaseGetManifestResponse,omitempty"` + Res *types.HttpNfcLeaseGetManifestResponse `xml:"HttpNfcLeaseGetManifestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6623,9 +7303,29 @@ 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:"urn:vim25 HttpNfcLeaseProgressResponse,omitempty"` + Res *types.HttpNfcLeaseProgressResponse `xml:"HttpNfcLeaseProgressResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6645,7 +7345,7 @@ func HttpNfcLeaseProgress(ctx context.Context, r soap.RoundTripper, req *types.H type HttpNfcLeasePullFromUrls_TaskBody struct { Req *types.HttpNfcLeasePullFromUrls_Task `xml:"urn:vim25 HttpNfcLeasePullFromUrls_Task,omitempty"` - Res *types.HttpNfcLeasePullFromUrls_TaskResponse `xml:"urn:vim25 HttpNfcLeasePullFromUrls_TaskResponse,omitempty"` + Res *types.HttpNfcLeasePullFromUrls_TaskResponse `xml:"HttpNfcLeasePullFromUrls_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6665,7 +7365,7 @@ func HttpNfcLeasePullFromUrls_Task(ctx context.Context, r soap.RoundTripper, req type HttpNfcLeaseSetManifestChecksumTypeBody struct { Req *types.HttpNfcLeaseSetManifestChecksumType `xml:"urn:vim25 HttpNfcLeaseSetManifestChecksumType,omitempty"` - Res *types.HttpNfcLeaseSetManifestChecksumTypeResponse `xml:"urn:vim25 HttpNfcLeaseSetManifestChecksumTypeResponse,omitempty"` + Res *types.HttpNfcLeaseSetManifestChecksumTypeResponse `xml:"HttpNfcLeaseSetManifestChecksumTypeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6685,7 +7385,7 @@ func HttpNfcLeaseSetManifestChecksumType(ctx context.Context, r soap.RoundTrippe type ImpersonateUserBody struct { Req *types.ImpersonateUser `xml:"urn:vim25 ImpersonateUser,omitempty"` - Res *types.ImpersonateUserResponse `xml:"urn:vim25 ImpersonateUserResponse,omitempty"` + Res *types.ImpersonateUserResponse `xml:"ImpersonateUserResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6705,7 +7405,7 @@ func ImpersonateUser(ctx context.Context, r soap.RoundTripper, req *types.Impers type ImportCertificateForCAM_TaskBody struct { Req *types.ImportCertificateForCAM_Task `xml:"urn:vim25 ImportCertificateForCAM_Task,omitempty"` - Res *types.ImportCertificateForCAM_TaskResponse `xml:"urn:vim25 ImportCertificateForCAM_TaskResponse,omitempty"` + Res *types.ImportCertificateForCAM_TaskResponse `xml:"ImportCertificateForCAM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6725,7 +7425,7 @@ func ImportCertificateForCAM_Task(ctx context.Context, r soap.RoundTripper, req type ImportUnmanagedSnapshotBody struct { Req *types.ImportUnmanagedSnapshot `xml:"urn:vim25 ImportUnmanagedSnapshot,omitempty"` - Res *types.ImportUnmanagedSnapshotResponse `xml:"urn:vim25 ImportUnmanagedSnapshotResponse,omitempty"` + Res *types.ImportUnmanagedSnapshotResponse `xml:"ImportUnmanagedSnapshotResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6745,7 +7445,7 @@ func ImportUnmanagedSnapshot(ctx context.Context, r soap.RoundTripper, req *type type ImportVAppBody struct { Req *types.ImportVApp `xml:"urn:vim25 ImportVApp,omitempty"` - Res *types.ImportVAppResponse `xml:"urn:vim25 ImportVAppResponse,omitempty"` + Res *types.ImportVAppResponse `xml:"ImportVAppResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6765,7 +7465,7 @@ func ImportVApp(ctx context.Context, r soap.RoundTripper, req *types.ImportVApp) type InflateDisk_TaskBody struct { Req *types.InflateDisk_Task `xml:"urn:vim25 InflateDisk_Task,omitempty"` - Res *types.InflateDisk_TaskResponse `xml:"urn:vim25 InflateDisk_TaskResponse,omitempty"` + Res *types.InflateDisk_TaskResponse `xml:"InflateDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6785,7 +7485,7 @@ func InflateDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.Infla type InflateVirtualDisk_TaskBody struct { Req *types.InflateVirtualDisk_Task `xml:"urn:vim25 InflateVirtualDisk_Task,omitempty"` - Res *types.InflateVirtualDisk_TaskResponse `xml:"urn:vim25 InflateVirtualDisk_TaskResponse,omitempty"` + Res *types.InflateVirtualDisk_TaskResponse `xml:"InflateVirtualDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6805,7 +7505,7 @@ func InflateVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *type type InitializeDisks_TaskBody struct { Req *types.InitializeDisks_Task `xml:"urn:vim25 InitializeDisks_Task,omitempty"` - Res *types.InitializeDisks_TaskResponse `xml:"urn:vim25 InitializeDisks_TaskResponse,omitempty"` + Res *types.InitializeDisks_TaskResponse `xml:"InitializeDisks_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6825,7 +7525,7 @@ func InitializeDisks_Task(ctx context.Context, r soap.RoundTripper, req *types.I type InitiateFileTransferFromGuestBody struct { Req *types.InitiateFileTransferFromGuest `xml:"urn:vim25 InitiateFileTransferFromGuest,omitempty"` - Res *types.InitiateFileTransferFromGuestResponse `xml:"urn:vim25 InitiateFileTransferFromGuestResponse,omitempty"` + Res *types.InitiateFileTransferFromGuestResponse `xml:"InitiateFileTransferFromGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6845,7 +7545,7 @@ func InitiateFileTransferFromGuest(ctx context.Context, r soap.RoundTripper, req type InitiateFileTransferToGuestBody struct { Req *types.InitiateFileTransferToGuest `xml:"urn:vim25 InitiateFileTransferToGuest,omitempty"` - Res *types.InitiateFileTransferToGuestResponse `xml:"urn:vim25 InitiateFileTransferToGuestResponse,omitempty"` + Res *types.InitiateFileTransferToGuestResponse `xml:"InitiateFileTransferToGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6865,7 +7565,7 @@ func InitiateFileTransferToGuest(ctx context.Context, r soap.RoundTripper, req * type InstallHostPatchV2_TaskBody struct { Req *types.InstallHostPatchV2_Task `xml:"urn:vim25 InstallHostPatchV2_Task,omitempty"` - Res *types.InstallHostPatchV2_TaskResponse `xml:"urn:vim25 InstallHostPatchV2_TaskResponse,omitempty"` + Res *types.InstallHostPatchV2_TaskResponse `xml:"InstallHostPatchV2_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6885,7 +7585,7 @@ func InstallHostPatchV2_Task(ctx context.Context, r soap.RoundTripper, req *type type InstallHostPatch_TaskBody struct { Req *types.InstallHostPatch_Task `xml:"urn:vim25 InstallHostPatch_Task,omitempty"` - Res *types.InstallHostPatch_TaskResponse `xml:"urn:vim25 InstallHostPatch_TaskResponse,omitempty"` + Res *types.InstallHostPatch_TaskResponse `xml:"InstallHostPatch_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6905,7 +7605,7 @@ func InstallHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types. type InstallIoFilter_TaskBody struct { Req *types.InstallIoFilter_Task `xml:"urn:vim25 InstallIoFilter_Task,omitempty"` - Res *types.InstallIoFilter_TaskResponse `xml:"urn:vim25 InstallIoFilter_TaskResponse,omitempty"` + Res *types.InstallIoFilter_TaskResponse `xml:"InstallIoFilter_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6925,7 +7625,7 @@ func InstallIoFilter_Task(ctx context.Context, r soap.RoundTripper, req *types.I type InstallServerCertificateBody struct { Req *types.InstallServerCertificate `xml:"urn:vim25 InstallServerCertificate,omitempty"` - Res *types.InstallServerCertificateResponse `xml:"urn:vim25 InstallServerCertificateResponse,omitempty"` + Res *types.InstallServerCertificateResponse `xml:"InstallServerCertificateResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6945,7 +7645,7 @@ func InstallServerCertificate(ctx context.Context, r soap.RoundTripper, req *typ type InstallSmartCardTrustAnchorBody struct { Req *types.InstallSmartCardTrustAnchor `xml:"urn:vim25 InstallSmartCardTrustAnchor,omitempty"` - Res *types.InstallSmartCardTrustAnchorResponse `xml:"urn:vim25 InstallSmartCardTrustAnchorResponse,omitempty"` + Res *types.InstallSmartCardTrustAnchorResponse `xml:"InstallSmartCardTrustAnchorResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6965,7 +7665,7 @@ func InstallSmartCardTrustAnchor(ctx context.Context, r soap.RoundTripper, req * type InstantClone_TaskBody struct { Req *types.InstantClone_Task `xml:"urn:vim25 InstantClone_Task,omitempty"` - Res *types.InstantClone_TaskResponse `xml:"urn:vim25 InstantClone_TaskResponse,omitempty"` + Res *types.InstantClone_TaskResponse `xml:"InstantClone_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -6983,9 +7683,29 @@ func InstantClone_Task(ctx context.Context, r soap.RoundTripper, req *types.Inst return resBody.Res, nil } +type IsKmsClusterActiveBody struct { + Req *types.IsKmsClusterActive `xml:"urn:vim25 IsKmsClusterActive,omitempty"` + Res *types.IsKmsClusterActiveResponse `xml:"IsKmsClusterActiveResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *IsKmsClusterActiveBody) Fault() *soap.Fault { return b.Fault_ } + +func IsKmsClusterActive(ctx context.Context, r soap.RoundTripper, req *types.IsKmsClusterActive) (*types.IsKmsClusterActiveResponse, error) { + var reqBody, resBody IsKmsClusterActiveBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type IsSharedGraphicsActiveBody struct { Req *types.IsSharedGraphicsActive `xml:"urn:vim25 IsSharedGraphicsActive,omitempty"` - Res *types.IsSharedGraphicsActiveResponse `xml:"urn:vim25 IsSharedGraphicsActiveResponse,omitempty"` + Res *types.IsSharedGraphicsActiveResponse `xml:"IsSharedGraphicsActiveResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7005,7 +7725,7 @@ func IsSharedGraphicsActive(ctx context.Context, r soap.RoundTripper, req *types type JoinDomainWithCAM_TaskBody struct { Req *types.JoinDomainWithCAM_Task `xml:"urn:vim25 JoinDomainWithCAM_Task,omitempty"` - Res *types.JoinDomainWithCAM_TaskResponse `xml:"urn:vim25 JoinDomainWithCAM_TaskResponse,omitempty"` + Res *types.JoinDomainWithCAM_TaskResponse `xml:"JoinDomainWithCAM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7025,7 +7745,7 @@ func JoinDomainWithCAM_Task(ctx context.Context, r soap.RoundTripper, req *types type JoinDomain_TaskBody struct { Req *types.JoinDomain_Task `xml:"urn:vim25 JoinDomain_Task,omitempty"` - Res *types.JoinDomain_TaskResponse `xml:"urn:vim25 JoinDomain_TaskResponse,omitempty"` + Res *types.JoinDomain_TaskResponse `xml:"JoinDomain_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7045,7 +7765,7 @@ func JoinDomain_Task(ctx context.Context, r soap.RoundTripper, req *types.JoinDo type LeaveCurrentDomain_TaskBody struct { Req *types.LeaveCurrentDomain_Task `xml:"urn:vim25 LeaveCurrentDomain_Task,omitempty"` - Res *types.LeaveCurrentDomain_TaskResponse `xml:"urn:vim25 LeaveCurrentDomain_TaskResponse,omitempty"` + Res *types.LeaveCurrentDomain_TaskResponse `xml:"LeaveCurrentDomain_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7065,7 +7785,7 @@ func LeaveCurrentDomain_Task(ctx context.Context, r soap.RoundTripper, req *type type ListCACertificateRevocationListsBody struct { Req *types.ListCACertificateRevocationLists `xml:"urn:vim25 ListCACertificateRevocationLists,omitempty"` - Res *types.ListCACertificateRevocationListsResponse `xml:"urn:vim25 ListCACertificateRevocationListsResponse,omitempty"` + Res *types.ListCACertificateRevocationListsResponse `xml:"ListCACertificateRevocationListsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7085,7 +7805,7 @@ func ListCACertificateRevocationLists(ctx context.Context, r soap.RoundTripper, type ListCACertificatesBody struct { Req *types.ListCACertificates `xml:"urn:vim25 ListCACertificates,omitempty"` - Res *types.ListCACertificatesResponse `xml:"urn:vim25 ListCACertificatesResponse,omitempty"` + Res *types.ListCACertificatesResponse `xml:"ListCACertificatesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7105,7 +7825,7 @@ func ListCACertificates(ctx context.Context, r soap.RoundTripper, req *types.Lis type ListFilesInGuestBody struct { Req *types.ListFilesInGuest `xml:"urn:vim25 ListFilesInGuest,omitempty"` - Res *types.ListFilesInGuestResponse `xml:"urn:vim25 ListFilesInGuestResponse,omitempty"` + Res *types.ListFilesInGuestResponse `xml:"ListFilesInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7125,7 +7845,7 @@ func ListFilesInGuest(ctx context.Context, r soap.RoundTripper, req *types.ListF type ListGuestAliasesBody struct { Req *types.ListGuestAliases `xml:"urn:vim25 ListGuestAliases,omitempty"` - Res *types.ListGuestAliasesResponse `xml:"urn:vim25 ListGuestAliasesResponse,omitempty"` + Res *types.ListGuestAliasesResponse `xml:"ListGuestAliasesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7145,7 +7865,7 @@ func ListGuestAliases(ctx context.Context, r soap.RoundTripper, req *types.ListG type ListGuestMappedAliasesBody struct { Req *types.ListGuestMappedAliases `xml:"urn:vim25 ListGuestMappedAliases,omitempty"` - Res *types.ListGuestMappedAliasesResponse `xml:"urn:vim25 ListGuestMappedAliasesResponse,omitempty"` + Res *types.ListGuestMappedAliasesResponse `xml:"ListGuestMappedAliasesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7165,7 +7885,7 @@ func ListGuestMappedAliases(ctx context.Context, r soap.RoundTripper, req *types type ListKeysBody struct { Req *types.ListKeys `xml:"urn:vim25 ListKeys,omitempty"` - Res *types.ListKeysResponse `xml:"urn:vim25 ListKeysResponse,omitempty"` + Res *types.ListKeysResponse `xml:"ListKeysResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7185,7 +7905,7 @@ func ListKeys(ctx context.Context, r soap.RoundTripper, req *types.ListKeys) (*t type ListKmipServersBody struct { Req *types.ListKmipServers `xml:"urn:vim25 ListKmipServers,omitempty"` - Res *types.ListKmipServersResponse `xml:"urn:vim25 ListKmipServersResponse,omitempty"` + Res *types.ListKmipServersResponse `xml:"ListKmipServersResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7203,9 +7923,29 @@ func ListKmipServers(ctx context.Context, r soap.RoundTripper, req *types.ListKm return resBody.Res, nil } +type ListKmsClustersBody struct { + Req *types.ListKmsClusters `xml:"urn:vim25 ListKmsClusters,omitempty"` + Res *types.ListKmsClustersResponse `xml:"ListKmsClustersResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ListKmsClustersBody) Fault() *soap.Fault { return b.Fault_ } + +func ListKmsClusters(ctx context.Context, r soap.RoundTripper, req *types.ListKmsClusters) (*types.ListKmsClustersResponse, error) { + var reqBody, resBody ListKmsClustersBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type ListProcessesInGuestBody struct { Req *types.ListProcessesInGuest `xml:"urn:vim25 ListProcessesInGuest,omitempty"` - Res *types.ListProcessesInGuestResponse `xml:"urn:vim25 ListProcessesInGuestResponse,omitempty"` + Res *types.ListProcessesInGuestResponse `xml:"ListProcessesInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7225,7 +7965,7 @@ func ListProcessesInGuest(ctx context.Context, r soap.RoundTripper, req *types.L type ListRegistryKeysInGuestBody struct { Req *types.ListRegistryKeysInGuest `xml:"urn:vim25 ListRegistryKeysInGuest,omitempty"` - Res *types.ListRegistryKeysInGuestResponse `xml:"urn:vim25 ListRegistryKeysInGuestResponse,omitempty"` + Res *types.ListRegistryKeysInGuestResponse `xml:"ListRegistryKeysInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7245,7 +7985,7 @@ func ListRegistryKeysInGuest(ctx context.Context, r soap.RoundTripper, req *type type ListRegistryValuesInGuestBody struct { Req *types.ListRegistryValuesInGuest `xml:"urn:vim25 ListRegistryValuesInGuest,omitempty"` - Res *types.ListRegistryValuesInGuestResponse `xml:"urn:vim25 ListRegistryValuesInGuestResponse,omitempty"` + Res *types.ListRegistryValuesInGuestResponse `xml:"ListRegistryValuesInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7265,7 +8005,7 @@ func ListRegistryValuesInGuest(ctx context.Context, r soap.RoundTripper, req *ty type ListSmartCardTrustAnchorsBody struct { Req *types.ListSmartCardTrustAnchors `xml:"urn:vim25 ListSmartCardTrustAnchors,omitempty"` - Res *types.ListSmartCardTrustAnchorsResponse `xml:"urn:vim25 ListSmartCardTrustAnchorsResponse,omitempty"` + Res *types.ListSmartCardTrustAnchorsResponse `xml:"ListSmartCardTrustAnchorsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7285,7 +8025,7 @@ func ListSmartCardTrustAnchors(ctx context.Context, r soap.RoundTripper, req *ty type ListTagsAttachedToVStorageObjectBody struct { Req *types.ListTagsAttachedToVStorageObject `xml:"urn:vim25 ListTagsAttachedToVStorageObject,omitempty"` - Res *types.ListTagsAttachedToVStorageObjectResponse `xml:"urn:vim25 ListTagsAttachedToVStorageObjectResponse,omitempty"` + Res *types.ListTagsAttachedToVStorageObjectResponse `xml:"ListTagsAttachedToVStorageObjectResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7305,7 +8045,7 @@ func ListTagsAttachedToVStorageObject(ctx context.Context, r soap.RoundTripper, type ListVStorageObjectBody struct { Req *types.ListVStorageObject `xml:"urn:vim25 ListVStorageObject,omitempty"` - Res *types.ListVStorageObjectResponse `xml:"urn:vim25 ListVStorageObjectResponse,omitempty"` + Res *types.ListVStorageObjectResponse `xml:"ListVStorageObjectResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7325,7 +8065,7 @@ func ListVStorageObject(ctx context.Context, r soap.RoundTripper, req *types.Lis type ListVStorageObjectsAttachedToTagBody struct { Req *types.ListVStorageObjectsAttachedToTag `xml:"urn:vim25 ListVStorageObjectsAttachedToTag,omitempty"` - Res *types.ListVStorageObjectsAttachedToTagResponse `xml:"urn:vim25 ListVStorageObjectsAttachedToTagResponse,omitempty"` + Res *types.ListVStorageObjectsAttachedToTagResponse `xml:"ListVStorageObjectsAttachedToTagResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7345,7 +8085,7 @@ func ListVStorageObjectsAttachedToTag(ctx context.Context, r soap.RoundTripper, type LogUserEventBody struct { Req *types.LogUserEvent `xml:"urn:vim25 LogUserEvent,omitempty"` - Res *types.LogUserEventResponse `xml:"urn:vim25 LogUserEventResponse,omitempty"` + Res *types.LogUserEventResponse `xml:"LogUserEventResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7365,7 +8105,7 @@ func LogUserEvent(ctx context.Context, r soap.RoundTripper, req *types.LogUserEv type LoginBody struct { Req *types.Login `xml:"urn:vim25 Login,omitempty"` - Res *types.LoginResponse `xml:"urn:vim25 LoginResponse,omitempty"` + Res *types.LoginResponse `xml:"LoginResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7385,7 +8125,7 @@ func Login(ctx context.Context, r soap.RoundTripper, req *types.Login) (*types.L type LoginBySSPIBody struct { Req *types.LoginBySSPI `xml:"urn:vim25 LoginBySSPI,omitempty"` - Res *types.LoginBySSPIResponse `xml:"urn:vim25 LoginBySSPIResponse,omitempty"` + Res *types.LoginBySSPIResponse `xml:"LoginBySSPIResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7405,7 +8145,7 @@ func LoginBySSPI(ctx context.Context, r soap.RoundTripper, req *types.LoginBySSP type LoginByTokenBody struct { Req *types.LoginByToken `xml:"urn:vim25 LoginByToken,omitempty"` - Res *types.LoginByTokenResponse `xml:"urn:vim25 LoginByTokenResponse,omitempty"` + Res *types.LoginByTokenResponse `xml:"LoginByTokenResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7425,7 +8165,7 @@ func LoginByToken(ctx context.Context, r soap.RoundTripper, req *types.LoginByTo type LoginExtensionByCertificateBody struct { Req *types.LoginExtensionByCertificate `xml:"urn:vim25 LoginExtensionByCertificate,omitempty"` - Res *types.LoginExtensionByCertificateResponse `xml:"urn:vim25 LoginExtensionByCertificateResponse,omitempty"` + Res *types.LoginExtensionByCertificateResponse `xml:"LoginExtensionByCertificateResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7445,7 +8185,7 @@ func LoginExtensionByCertificate(ctx context.Context, r soap.RoundTripper, req * type LoginExtensionBySubjectNameBody struct { Req *types.LoginExtensionBySubjectName `xml:"urn:vim25 LoginExtensionBySubjectName,omitempty"` - Res *types.LoginExtensionBySubjectNameResponse `xml:"urn:vim25 LoginExtensionBySubjectNameResponse,omitempty"` + Res *types.LoginExtensionBySubjectNameResponse `xml:"LoginExtensionBySubjectNameResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7465,7 +8205,7 @@ func LoginExtensionBySubjectName(ctx context.Context, r soap.RoundTripper, req * type LogoutBody struct { Req *types.Logout `xml:"urn:vim25 Logout,omitempty"` - Res *types.LogoutResponse `xml:"urn:vim25 LogoutResponse,omitempty"` + Res *types.LogoutResponse `xml:"LogoutResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7485,7 +8225,7 @@ func Logout(ctx context.Context, r soap.RoundTripper, req *types.Logout) (*types type LookupDvPortGroupBody struct { Req *types.LookupDvPortGroup `xml:"urn:vim25 LookupDvPortGroup,omitempty"` - Res *types.LookupDvPortGroupResponse `xml:"urn:vim25 LookupDvPortGroupResponse,omitempty"` + Res *types.LookupDvPortGroupResponse `xml:"LookupDvPortGroupResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7505,7 +8245,7 @@ func LookupDvPortGroup(ctx context.Context, r soap.RoundTripper, req *types.Look type LookupVmOverheadMemoryBody struct { Req *types.LookupVmOverheadMemory `xml:"urn:vim25 LookupVmOverheadMemory,omitempty"` - Res *types.LookupVmOverheadMemoryResponse `xml:"urn:vim25 LookupVmOverheadMemoryResponse,omitempty"` + Res *types.LookupVmOverheadMemoryResponse `xml:"LookupVmOverheadMemoryResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7525,7 +8265,7 @@ func LookupVmOverheadMemory(ctx context.Context, r soap.RoundTripper, req *types type MakeDirectoryBody struct { Req *types.MakeDirectory `xml:"urn:vim25 MakeDirectory,omitempty"` - Res *types.MakeDirectoryResponse `xml:"urn:vim25 MakeDirectoryResponse,omitempty"` + Res *types.MakeDirectoryResponse `xml:"MakeDirectoryResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7545,7 +8285,7 @@ func MakeDirectory(ctx context.Context, r soap.RoundTripper, req *types.MakeDire type MakeDirectoryInGuestBody struct { Req *types.MakeDirectoryInGuest `xml:"urn:vim25 MakeDirectoryInGuest,omitempty"` - Res *types.MakeDirectoryInGuestResponse `xml:"urn:vim25 MakeDirectoryInGuestResponse,omitempty"` + Res *types.MakeDirectoryInGuestResponse `xml:"MakeDirectoryInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7565,7 +8305,7 @@ func MakeDirectoryInGuest(ctx context.Context, r soap.RoundTripper, req *types.M type MakePrimaryVM_TaskBody struct { Req *types.MakePrimaryVM_Task `xml:"urn:vim25 MakePrimaryVM_Task,omitempty"` - Res *types.MakePrimaryVM_TaskResponse `xml:"urn:vim25 MakePrimaryVM_TaskResponse,omitempty"` + Res *types.MakePrimaryVM_TaskResponse `xml:"MakePrimaryVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7585,7 +8325,7 @@ func MakePrimaryVM_Task(ctx context.Context, r soap.RoundTripper, req *types.Mak type MarkAsLocal_TaskBody struct { Req *types.MarkAsLocal_Task `xml:"urn:vim25 MarkAsLocal_Task,omitempty"` - Res *types.MarkAsLocal_TaskResponse `xml:"urn:vim25 MarkAsLocal_TaskResponse,omitempty"` + Res *types.MarkAsLocal_TaskResponse `xml:"MarkAsLocal_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7605,7 +8345,7 @@ func MarkAsLocal_Task(ctx context.Context, r soap.RoundTripper, req *types.MarkA type MarkAsNonLocal_TaskBody struct { Req *types.MarkAsNonLocal_Task `xml:"urn:vim25 MarkAsNonLocal_Task,omitempty"` - Res *types.MarkAsNonLocal_TaskResponse `xml:"urn:vim25 MarkAsNonLocal_TaskResponse,omitempty"` + Res *types.MarkAsNonLocal_TaskResponse `xml:"MarkAsNonLocal_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7625,7 +8365,7 @@ func MarkAsNonLocal_Task(ctx context.Context, r soap.RoundTripper, req *types.Ma type MarkAsNonSsd_TaskBody struct { Req *types.MarkAsNonSsd_Task `xml:"urn:vim25 MarkAsNonSsd_Task,omitempty"` - Res *types.MarkAsNonSsd_TaskResponse `xml:"urn:vim25 MarkAsNonSsd_TaskResponse,omitempty"` + Res *types.MarkAsNonSsd_TaskResponse `xml:"MarkAsNonSsd_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7645,7 +8385,7 @@ func MarkAsNonSsd_Task(ctx context.Context, r soap.RoundTripper, req *types.Mark type MarkAsSsd_TaskBody struct { Req *types.MarkAsSsd_Task `xml:"urn:vim25 MarkAsSsd_Task,omitempty"` - Res *types.MarkAsSsd_TaskResponse `xml:"urn:vim25 MarkAsSsd_TaskResponse,omitempty"` + Res *types.MarkAsSsd_TaskResponse `xml:"MarkAsSsd_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7665,7 +8405,7 @@ func MarkAsSsd_Task(ctx context.Context, r soap.RoundTripper, req *types.MarkAsS type MarkAsTemplateBody struct { Req *types.MarkAsTemplate `xml:"urn:vim25 MarkAsTemplate,omitempty"` - Res *types.MarkAsTemplateResponse `xml:"urn:vim25 MarkAsTemplateResponse,omitempty"` + Res *types.MarkAsTemplateResponse `xml:"MarkAsTemplateResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7685,7 +8425,7 @@ func MarkAsTemplate(ctx context.Context, r soap.RoundTripper, req *types.MarkAsT type MarkAsVirtualMachineBody struct { Req *types.MarkAsVirtualMachine `xml:"urn:vim25 MarkAsVirtualMachine,omitempty"` - Res *types.MarkAsVirtualMachineResponse `xml:"urn:vim25 MarkAsVirtualMachineResponse,omitempty"` + Res *types.MarkAsVirtualMachineResponse `xml:"MarkAsVirtualMachineResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7705,7 +8445,7 @@ func MarkAsVirtualMachine(ctx context.Context, r soap.RoundTripper, req *types.M type MarkDefaultBody struct { Req *types.MarkDefault `xml:"urn:vim25 MarkDefault,omitempty"` - Res *types.MarkDefaultResponse `xml:"urn:vim25 MarkDefaultResponse,omitempty"` + Res *types.MarkDefaultResponse `xml:"MarkDefaultResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7725,7 +8465,7 @@ func MarkDefault(ctx context.Context, r soap.RoundTripper, req *types.MarkDefaul type MarkForRemovalBody struct { Req *types.MarkForRemoval `xml:"urn:vim25 MarkForRemoval,omitempty"` - Res *types.MarkForRemovalResponse `xml:"urn:vim25 MarkForRemovalResponse,omitempty"` + Res *types.MarkForRemovalResponse `xml:"MarkForRemovalResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7743,9 +8483,69 @@ func MarkForRemoval(ctx context.Context, r soap.RoundTripper, req *types.MarkFor return resBody.Res, nil } +type MarkPerenniallyReservedBody struct { + Req *types.MarkPerenniallyReserved `xml:"urn:vim25 MarkPerenniallyReserved,omitempty"` + Res *types.MarkPerenniallyReservedResponse `xml:"MarkPerenniallyReservedResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MarkPerenniallyReservedBody) Fault() *soap.Fault { return b.Fault_ } + +func MarkPerenniallyReserved(ctx context.Context, r soap.RoundTripper, req *types.MarkPerenniallyReserved) (*types.MarkPerenniallyReservedResponse, error) { + var reqBody, resBody MarkPerenniallyReservedBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MarkPerenniallyReservedEx_TaskBody struct { + Req *types.MarkPerenniallyReservedEx_Task `xml:"urn:vim25 MarkPerenniallyReservedEx_Task,omitempty"` + Res *types.MarkPerenniallyReservedEx_TaskResponse `xml:"MarkPerenniallyReservedEx_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MarkPerenniallyReservedEx_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func MarkPerenniallyReservedEx_Task(ctx context.Context, r soap.RoundTripper, req *types.MarkPerenniallyReservedEx_Task) (*types.MarkPerenniallyReservedEx_TaskResponse, error) { + var reqBody, resBody MarkPerenniallyReservedEx_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type MarkServiceProviderEntitiesBody struct { + Req *types.MarkServiceProviderEntities `xml:"urn:vim25 MarkServiceProviderEntities,omitempty"` + Res *types.MarkServiceProviderEntitiesResponse `xml:"MarkServiceProviderEntitiesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *MarkServiceProviderEntitiesBody) Fault() *soap.Fault { return b.Fault_ } + +func MarkServiceProviderEntities(ctx context.Context, r soap.RoundTripper, req *types.MarkServiceProviderEntities) (*types.MarkServiceProviderEntitiesResponse, error) { + var reqBody, resBody MarkServiceProviderEntitiesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type MergeDvs_TaskBody struct { Req *types.MergeDvs_Task `xml:"urn:vim25 MergeDvs_Task,omitempty"` - Res *types.MergeDvs_TaskResponse `xml:"urn:vim25 MergeDvs_TaskResponse,omitempty"` + Res *types.MergeDvs_TaskResponse `xml:"MergeDvs_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7765,7 +8565,7 @@ func MergeDvs_Task(ctx context.Context, r soap.RoundTripper, req *types.MergeDvs type MergePermissionsBody struct { Req *types.MergePermissions `xml:"urn:vim25 MergePermissions,omitempty"` - Res *types.MergePermissionsResponse `xml:"urn:vim25 MergePermissionsResponse,omitempty"` + Res *types.MergePermissionsResponse `xml:"MergePermissionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7785,7 +8585,7 @@ func MergePermissions(ctx context.Context, r soap.RoundTripper, req *types.Merge type MigrateVM_TaskBody struct { Req *types.MigrateVM_Task `xml:"urn:vim25 MigrateVM_Task,omitempty"` - Res *types.MigrateVM_TaskResponse `xml:"urn:vim25 MigrateVM_TaskResponse,omitempty"` + Res *types.MigrateVM_TaskResponse `xml:"MigrateVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7805,7 +8605,7 @@ func MigrateVM_Task(ctx context.Context, r soap.RoundTripper, req *types.Migrate type ModifyListViewBody struct { Req *types.ModifyListView `xml:"urn:vim25 ModifyListView,omitempty"` - Res *types.ModifyListViewResponse `xml:"urn:vim25 ModifyListViewResponse,omitempty"` + Res *types.ModifyListViewResponse `xml:"ModifyListViewResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7825,7 +8625,7 @@ func ModifyListView(ctx context.Context, r soap.RoundTripper, req *types.ModifyL type MountToolsInstallerBody struct { Req *types.MountToolsInstaller `xml:"urn:vim25 MountToolsInstaller,omitempty"` - Res *types.MountToolsInstallerResponse `xml:"urn:vim25 MountToolsInstallerResponse,omitempty"` + Res *types.MountToolsInstallerResponse `xml:"MountToolsInstallerResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7845,7 +8645,7 @@ func MountToolsInstaller(ctx context.Context, r soap.RoundTripper, req *types.Mo type MountVffsVolumeBody struct { Req *types.MountVffsVolume `xml:"urn:vim25 MountVffsVolume,omitempty"` - Res *types.MountVffsVolumeResponse `xml:"urn:vim25 MountVffsVolumeResponse,omitempty"` + Res *types.MountVffsVolumeResponse `xml:"MountVffsVolumeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7865,7 +8665,7 @@ func MountVffsVolume(ctx context.Context, r soap.RoundTripper, req *types.MountV type MountVmfsVolumeBody struct { Req *types.MountVmfsVolume `xml:"urn:vim25 MountVmfsVolume,omitempty"` - Res *types.MountVmfsVolumeResponse `xml:"urn:vim25 MountVmfsVolumeResponse,omitempty"` + Res *types.MountVmfsVolumeResponse `xml:"MountVmfsVolumeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7885,7 +8685,7 @@ func MountVmfsVolume(ctx context.Context, r soap.RoundTripper, req *types.MountV type MountVmfsVolumeEx_TaskBody struct { Req *types.MountVmfsVolumeEx_Task `xml:"urn:vim25 MountVmfsVolumeEx_Task,omitempty"` - Res *types.MountVmfsVolumeEx_TaskResponse `xml:"urn:vim25 MountVmfsVolumeEx_TaskResponse,omitempty"` + Res *types.MountVmfsVolumeEx_TaskResponse `xml:"MountVmfsVolumeEx_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7905,7 +8705,7 @@ func MountVmfsVolumeEx_Task(ctx context.Context, r soap.RoundTripper, req *types type MoveDVPort_TaskBody struct { Req *types.MoveDVPort_Task `xml:"urn:vim25 MoveDVPort_Task,omitempty"` - Res *types.MoveDVPort_TaskResponse `xml:"urn:vim25 MoveDVPort_TaskResponse,omitempty"` + Res *types.MoveDVPort_TaskResponse `xml:"MoveDVPort_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7925,7 +8725,7 @@ func MoveDVPort_Task(ctx context.Context, r soap.RoundTripper, req *types.MoveDV type MoveDatastoreFile_TaskBody struct { Req *types.MoveDatastoreFile_Task `xml:"urn:vim25 MoveDatastoreFile_Task,omitempty"` - Res *types.MoveDatastoreFile_TaskResponse `xml:"urn:vim25 MoveDatastoreFile_TaskResponse,omitempty"` + Res *types.MoveDatastoreFile_TaskResponse `xml:"MoveDatastoreFile_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7945,7 +8745,7 @@ func MoveDatastoreFile_Task(ctx context.Context, r soap.RoundTripper, req *types type MoveDirectoryInGuestBody struct { Req *types.MoveDirectoryInGuest `xml:"urn:vim25 MoveDirectoryInGuest,omitempty"` - Res *types.MoveDirectoryInGuestResponse `xml:"urn:vim25 MoveDirectoryInGuestResponse,omitempty"` + Res *types.MoveDirectoryInGuestResponse `xml:"MoveDirectoryInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7965,7 +8765,7 @@ func MoveDirectoryInGuest(ctx context.Context, r soap.RoundTripper, req *types.M type MoveFileInGuestBody struct { Req *types.MoveFileInGuest `xml:"urn:vim25 MoveFileInGuest,omitempty"` - Res *types.MoveFileInGuestResponse `xml:"urn:vim25 MoveFileInGuestResponse,omitempty"` + Res *types.MoveFileInGuestResponse `xml:"MoveFileInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -7985,7 +8785,7 @@ func MoveFileInGuest(ctx context.Context, r soap.RoundTripper, req *types.MoveFi type MoveHostInto_TaskBody struct { Req *types.MoveHostInto_Task `xml:"urn:vim25 MoveHostInto_Task,omitempty"` - Res *types.MoveHostInto_TaskResponse `xml:"urn:vim25 MoveHostInto_TaskResponse,omitempty"` + Res *types.MoveHostInto_TaskResponse `xml:"MoveHostInto_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8005,7 +8805,7 @@ func MoveHostInto_Task(ctx context.Context, r soap.RoundTripper, req *types.Move type MoveIntoFolder_TaskBody struct { Req *types.MoveIntoFolder_Task `xml:"urn:vim25 MoveIntoFolder_Task,omitempty"` - Res *types.MoveIntoFolder_TaskResponse `xml:"urn:vim25 MoveIntoFolder_TaskResponse,omitempty"` + Res *types.MoveIntoFolder_TaskResponse `xml:"MoveIntoFolder_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8025,7 +8825,7 @@ func MoveIntoFolder_Task(ctx context.Context, r soap.RoundTripper, req *types.Mo type MoveIntoResourcePoolBody struct { Req *types.MoveIntoResourcePool `xml:"urn:vim25 MoveIntoResourcePool,omitempty"` - Res *types.MoveIntoResourcePoolResponse `xml:"urn:vim25 MoveIntoResourcePoolResponse,omitempty"` + Res *types.MoveIntoResourcePoolResponse `xml:"MoveIntoResourcePoolResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8045,7 +8845,7 @@ func MoveIntoResourcePool(ctx context.Context, r soap.RoundTripper, req *types.M type MoveInto_TaskBody struct { Req *types.MoveInto_Task `xml:"urn:vim25 MoveInto_Task,omitempty"` - Res *types.MoveInto_TaskResponse `xml:"urn:vim25 MoveInto_TaskResponse,omitempty"` + Res *types.MoveInto_TaskResponse `xml:"MoveInto_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8065,7 +8865,7 @@ func MoveInto_Task(ctx context.Context, r soap.RoundTripper, req *types.MoveInto type MoveVirtualDisk_TaskBody struct { Req *types.MoveVirtualDisk_Task `xml:"urn:vim25 MoveVirtualDisk_Task,omitempty"` - Res *types.MoveVirtualDisk_TaskResponse `xml:"urn:vim25 MoveVirtualDisk_TaskResponse,omitempty"` + Res *types.MoveVirtualDisk_TaskResponse `xml:"MoveVirtualDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8085,7 +8885,7 @@ func MoveVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.M type OpenInventoryViewFolderBody struct { Req *types.OpenInventoryViewFolder `xml:"urn:vim25 OpenInventoryViewFolder,omitempty"` - Res *types.OpenInventoryViewFolderResponse `xml:"urn:vim25 OpenInventoryViewFolderResponse,omitempty"` + Res *types.OpenInventoryViewFolderResponse `xml:"OpenInventoryViewFolderResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8105,7 +8905,7 @@ func OpenInventoryViewFolder(ctx context.Context, r soap.RoundTripper, req *type type OverwriteCustomizationSpecBody struct { Req *types.OverwriteCustomizationSpec `xml:"urn:vim25 OverwriteCustomizationSpec,omitempty"` - Res *types.OverwriteCustomizationSpecResponse `xml:"urn:vim25 OverwriteCustomizationSpecResponse,omitempty"` + Res *types.OverwriteCustomizationSpecResponse `xml:"OverwriteCustomizationSpecResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8125,7 +8925,7 @@ func OverwriteCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *t type ParseDescriptorBody struct { Req *types.ParseDescriptor `xml:"urn:vim25 ParseDescriptor,omitempty"` - Res *types.ParseDescriptorResponse `xml:"urn:vim25 ParseDescriptorResponse,omitempty"` + Res *types.ParseDescriptorResponse `xml:"ParseDescriptorResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8145,7 +8945,7 @@ func ParseDescriptor(ctx context.Context, r soap.RoundTripper, req *types.ParseD type PerformDvsProductSpecOperation_TaskBody struct { Req *types.PerformDvsProductSpecOperation_Task `xml:"urn:vim25 PerformDvsProductSpecOperation_Task,omitempty"` - Res *types.PerformDvsProductSpecOperation_TaskResponse `xml:"urn:vim25 PerformDvsProductSpecOperation_TaskResponse,omitempty"` + Res *types.PerformDvsProductSpecOperation_TaskResponse `xml:"PerformDvsProductSpecOperation_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8165,7 +8965,7 @@ func PerformDvsProductSpecOperation_Task(ctx context.Context, r soap.RoundTrippe type PerformVsanUpgradePreflightCheckBody struct { Req *types.PerformVsanUpgradePreflightCheck `xml:"urn:vim25 PerformVsanUpgradePreflightCheck,omitempty"` - Res *types.PerformVsanUpgradePreflightCheckResponse `xml:"urn:vim25 PerformVsanUpgradePreflightCheckResponse,omitempty"` + Res *types.PerformVsanUpgradePreflightCheckResponse `xml:"PerformVsanUpgradePreflightCheckResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8185,7 +8985,7 @@ func PerformVsanUpgradePreflightCheck(ctx context.Context, r soap.RoundTripper, type PerformVsanUpgrade_TaskBody struct { Req *types.PerformVsanUpgrade_Task `xml:"urn:vim25 PerformVsanUpgrade_Task,omitempty"` - Res *types.PerformVsanUpgrade_TaskResponse `xml:"urn:vim25 PerformVsanUpgrade_TaskResponse,omitempty"` + Res *types.PerformVsanUpgrade_TaskResponse `xml:"PerformVsanUpgrade_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8205,7 +9005,7 @@ func PerformVsanUpgrade_Task(ctx context.Context, r soap.RoundTripper, req *type type PlaceVmBody struct { Req *types.PlaceVm `xml:"urn:vim25 PlaceVm,omitempty"` - Res *types.PlaceVmResponse `xml:"urn:vim25 PlaceVmResponse,omitempty"` + Res *types.PlaceVmResponse `xml:"PlaceVmResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8225,7 +9025,7 @@ func PlaceVm(ctx context.Context, r soap.RoundTripper, req *types.PlaceVm) (*typ type PostEventBody struct { Req *types.PostEvent `xml:"urn:vim25 PostEvent,omitempty"` - Res *types.PostEventResponse `xml:"urn:vim25 PostEventResponse,omitempty"` + Res *types.PostEventResponse `xml:"PostEventResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8245,7 +9045,7 @@ func PostEvent(ctx context.Context, r soap.RoundTripper, req *types.PostEvent) ( type PostHealthUpdatesBody struct { Req *types.PostHealthUpdates `xml:"urn:vim25 PostHealthUpdates,omitempty"` - Res *types.PostHealthUpdatesResponse `xml:"urn:vim25 PostHealthUpdatesResponse,omitempty"` + Res *types.PostHealthUpdatesResponse `xml:"PostHealthUpdatesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8265,7 +9065,7 @@ func PostHealthUpdates(ctx context.Context, r soap.RoundTripper, req *types.Post type PowerDownHostToStandBy_TaskBody struct { Req *types.PowerDownHostToStandBy_Task `xml:"urn:vim25 PowerDownHostToStandBy_Task,omitempty"` - Res *types.PowerDownHostToStandBy_TaskResponse `xml:"urn:vim25 PowerDownHostToStandBy_TaskResponse,omitempty"` + Res *types.PowerDownHostToStandBy_TaskResponse `xml:"PowerDownHostToStandBy_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8285,7 +9085,7 @@ func PowerDownHostToStandBy_Task(ctx context.Context, r soap.RoundTripper, req * type PowerOffVApp_TaskBody struct { Req *types.PowerOffVApp_Task `xml:"urn:vim25 PowerOffVApp_Task,omitempty"` - Res *types.PowerOffVApp_TaskResponse `xml:"urn:vim25 PowerOffVApp_TaskResponse,omitempty"` + Res *types.PowerOffVApp_TaskResponse `xml:"PowerOffVApp_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8305,7 +9105,7 @@ func PowerOffVApp_Task(ctx context.Context, r soap.RoundTripper, req *types.Powe type PowerOffVM_TaskBody struct { Req *types.PowerOffVM_Task `xml:"urn:vim25 PowerOffVM_Task,omitempty"` - Res *types.PowerOffVM_TaskResponse `xml:"urn:vim25 PowerOffVM_TaskResponse,omitempty"` + Res *types.PowerOffVM_TaskResponse `xml:"PowerOffVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8325,7 +9125,7 @@ func PowerOffVM_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerO type PowerOnMultiVM_TaskBody struct { Req *types.PowerOnMultiVM_Task `xml:"urn:vim25 PowerOnMultiVM_Task,omitempty"` - Res *types.PowerOnMultiVM_TaskResponse `xml:"urn:vim25 PowerOnMultiVM_TaskResponse,omitempty"` + Res *types.PowerOnMultiVM_TaskResponse `xml:"PowerOnMultiVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8345,7 +9145,7 @@ func PowerOnMultiVM_Task(ctx context.Context, r soap.RoundTripper, req *types.Po type PowerOnVApp_TaskBody struct { Req *types.PowerOnVApp_Task `xml:"urn:vim25 PowerOnVApp_Task,omitempty"` - Res *types.PowerOnVApp_TaskResponse `xml:"urn:vim25 PowerOnVApp_TaskResponse,omitempty"` + Res *types.PowerOnVApp_TaskResponse `xml:"PowerOnVApp_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8365,7 +9165,7 @@ func PowerOnVApp_Task(ctx context.Context, r soap.RoundTripper, req *types.Power type PowerOnVM_TaskBody struct { Req *types.PowerOnVM_Task `xml:"urn:vim25 PowerOnVM_Task,omitempty"` - Res *types.PowerOnVM_TaskResponse `xml:"urn:vim25 PowerOnVM_TaskResponse,omitempty"` + Res *types.PowerOnVM_TaskResponse `xml:"PowerOnVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8385,7 +9185,7 @@ func PowerOnVM_Task(ctx context.Context, r soap.RoundTripper, req *types.PowerOn type PowerUpHostFromStandBy_TaskBody struct { Req *types.PowerUpHostFromStandBy_Task `xml:"urn:vim25 PowerUpHostFromStandBy_Task,omitempty"` - Res *types.PowerUpHostFromStandBy_TaskResponse `xml:"urn:vim25 PowerUpHostFromStandBy_TaskResponse,omitempty"` + Res *types.PowerUpHostFromStandBy_TaskResponse `xml:"PowerUpHostFromStandBy_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8405,7 +9205,7 @@ func PowerUpHostFromStandBy_Task(ctx context.Context, r soap.RoundTripper, req * type PrepareCryptoBody struct { Req *types.PrepareCrypto `xml:"urn:vim25 PrepareCrypto,omitempty"` - Res *types.PrepareCryptoResponse `xml:"urn:vim25 PrepareCryptoResponse,omitempty"` + Res *types.PrepareCryptoResponse `xml:"PrepareCryptoResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8425,7 +9225,7 @@ func PrepareCrypto(ctx context.Context, r soap.RoundTripper, req *types.PrepareC type PromoteDisks_TaskBody struct { Req *types.PromoteDisks_Task `xml:"urn:vim25 PromoteDisks_Task,omitempty"` - Res *types.PromoteDisks_TaskResponse `xml:"urn:vim25 PromoteDisks_TaskResponse,omitempty"` + Res *types.PromoteDisks_TaskResponse `xml:"PromoteDisks_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8445,7 +9245,7 @@ func PromoteDisks_Task(ctx context.Context, r soap.RoundTripper, req *types.Prom type PutUsbScanCodesBody struct { Req *types.PutUsbScanCodes `xml:"urn:vim25 PutUsbScanCodes,omitempty"` - Res *types.PutUsbScanCodesResponse `xml:"urn:vim25 PutUsbScanCodesResponse,omitempty"` + Res *types.PutUsbScanCodesResponse `xml:"PutUsbScanCodesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8465,7 +9265,7 @@ func PutUsbScanCodes(ctx context.Context, r soap.RoundTripper, req *types.PutUsb type QueryAnswerFileStatusBody struct { Req *types.QueryAnswerFileStatus `xml:"urn:vim25 QueryAnswerFileStatus,omitempty"` - Res *types.QueryAnswerFileStatusResponse `xml:"urn:vim25 QueryAnswerFileStatusResponse,omitempty"` + Res *types.QueryAnswerFileStatusResponse `xml:"QueryAnswerFileStatusResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8485,7 +9285,7 @@ func QueryAnswerFileStatus(ctx context.Context, r soap.RoundTripper, req *types. type QueryAssignedLicensesBody struct { Req *types.QueryAssignedLicenses `xml:"urn:vim25 QueryAssignedLicenses,omitempty"` - Res *types.QueryAssignedLicensesResponse `xml:"urn:vim25 QueryAssignedLicensesResponse,omitempty"` + Res *types.QueryAssignedLicensesResponse `xml:"QueryAssignedLicensesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8505,7 +9305,7 @@ func QueryAssignedLicenses(ctx context.Context, r soap.RoundTripper, req *types. type QueryAvailableDisksForVmfsBody struct { Req *types.QueryAvailableDisksForVmfs `xml:"urn:vim25 QueryAvailableDisksForVmfs,omitempty"` - Res *types.QueryAvailableDisksForVmfsResponse `xml:"urn:vim25 QueryAvailableDisksForVmfsResponse,omitempty"` + Res *types.QueryAvailableDisksForVmfsResponse `xml:"QueryAvailableDisksForVmfsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8525,7 +9325,7 @@ func QueryAvailableDisksForVmfs(ctx context.Context, r soap.RoundTripper, req *t type QueryAvailableDvsSpecBody struct { Req *types.QueryAvailableDvsSpec `xml:"urn:vim25 QueryAvailableDvsSpec,omitempty"` - Res *types.QueryAvailableDvsSpecResponse `xml:"urn:vim25 QueryAvailableDvsSpecResponse,omitempty"` + Res *types.QueryAvailableDvsSpecResponse `xml:"QueryAvailableDvsSpecResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8545,7 +9345,7 @@ func QueryAvailableDvsSpec(ctx context.Context, r soap.RoundTripper, req *types. type QueryAvailablePartitionBody struct { Req *types.QueryAvailablePartition `xml:"urn:vim25 QueryAvailablePartition,omitempty"` - Res *types.QueryAvailablePartitionResponse `xml:"urn:vim25 QueryAvailablePartitionResponse,omitempty"` + Res *types.QueryAvailablePartitionResponse `xml:"QueryAvailablePartitionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8565,7 +9365,7 @@ func QueryAvailablePartition(ctx context.Context, r soap.RoundTripper, req *type type QueryAvailablePerfMetricBody struct { Req *types.QueryAvailablePerfMetric `xml:"urn:vim25 QueryAvailablePerfMetric,omitempty"` - Res *types.QueryAvailablePerfMetricResponse `xml:"urn:vim25 QueryAvailablePerfMetricResponse,omitempty"` + Res *types.QueryAvailablePerfMetricResponse `xml:"QueryAvailablePerfMetricResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8585,7 +9385,7 @@ func QueryAvailablePerfMetric(ctx context.Context, r soap.RoundTripper, req *typ type QueryAvailableSsdsBody struct { Req *types.QueryAvailableSsds `xml:"urn:vim25 QueryAvailableSsds,omitempty"` - Res *types.QueryAvailableSsdsResponse `xml:"urn:vim25 QueryAvailableSsdsResponse,omitempty"` + Res *types.QueryAvailableSsdsResponse `xml:"QueryAvailableSsdsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8605,7 +9405,7 @@ func QueryAvailableSsds(ctx context.Context, r soap.RoundTripper, req *types.Que type QueryAvailableTimeZonesBody struct { Req *types.QueryAvailableTimeZones `xml:"urn:vim25 QueryAvailableTimeZones,omitempty"` - Res *types.QueryAvailableTimeZonesResponse `xml:"urn:vim25 QueryAvailableTimeZonesResponse,omitempty"` + Res *types.QueryAvailableTimeZonesResponse `xml:"QueryAvailableTimeZonesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8625,7 +9425,7 @@ func QueryAvailableTimeZones(ctx context.Context, r soap.RoundTripper, req *type type QueryBootDevicesBody struct { Req *types.QueryBootDevices `xml:"urn:vim25 QueryBootDevices,omitempty"` - Res *types.QueryBootDevicesResponse `xml:"urn:vim25 QueryBootDevicesResponse,omitempty"` + Res *types.QueryBootDevicesResponse `xml:"QueryBootDevicesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8645,7 +9445,7 @@ func QueryBootDevices(ctx context.Context, r soap.RoundTripper, req *types.Query type QueryBoundVnicsBody struct { Req *types.QueryBoundVnics `xml:"urn:vim25 QueryBoundVnics,omitempty"` - Res *types.QueryBoundVnicsResponse `xml:"urn:vim25 QueryBoundVnicsResponse,omitempty"` + Res *types.QueryBoundVnicsResponse `xml:"QueryBoundVnicsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8665,7 +9465,7 @@ func QueryBoundVnics(ctx context.Context, r soap.RoundTripper, req *types.QueryB type QueryCandidateNicsBody struct { Req *types.QueryCandidateNics `xml:"urn:vim25 QueryCandidateNics,omitempty"` - Res *types.QueryCandidateNicsResponse `xml:"urn:vim25 QueryCandidateNicsResponse,omitempty"` + Res *types.QueryCandidateNicsResponse `xml:"QueryCandidateNicsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8685,7 +9485,7 @@ func QueryCandidateNics(ctx context.Context, r soap.RoundTripper, req *types.Que type QueryChangedDiskAreasBody struct { Req *types.QueryChangedDiskAreas `xml:"urn:vim25 QueryChangedDiskAreas,omitempty"` - Res *types.QueryChangedDiskAreasResponse `xml:"urn:vim25 QueryChangedDiskAreasResponse,omitempty"` + Res *types.QueryChangedDiskAreasResponse `xml:"QueryChangedDiskAreasResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8705,7 +9505,7 @@ func QueryChangedDiskAreas(ctx context.Context, r soap.RoundTripper, req *types. type QueryCmmdsBody struct { Req *types.QueryCmmds `xml:"urn:vim25 QueryCmmds,omitempty"` - Res *types.QueryCmmdsResponse `xml:"urn:vim25 QueryCmmdsResponse,omitempty"` + Res *types.QueryCmmdsResponse `xml:"QueryCmmdsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8725,7 +9525,7 @@ func QueryCmmds(ctx context.Context, r soap.RoundTripper, req *types.QueryCmmds) type QueryCompatibleHostForExistingDvsBody struct { Req *types.QueryCompatibleHostForExistingDvs `xml:"urn:vim25 QueryCompatibleHostForExistingDvs,omitempty"` - Res *types.QueryCompatibleHostForExistingDvsResponse `xml:"urn:vim25 QueryCompatibleHostForExistingDvsResponse,omitempty"` + Res *types.QueryCompatibleHostForExistingDvsResponse `xml:"QueryCompatibleHostForExistingDvsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8745,7 +9545,7 @@ func QueryCompatibleHostForExistingDvs(ctx context.Context, r soap.RoundTripper, type QueryCompatibleHostForNewDvsBody struct { Req *types.QueryCompatibleHostForNewDvs `xml:"urn:vim25 QueryCompatibleHostForNewDvs,omitempty"` - Res *types.QueryCompatibleHostForNewDvsResponse `xml:"urn:vim25 QueryCompatibleHostForNewDvsResponse,omitempty"` + Res *types.QueryCompatibleHostForNewDvsResponse `xml:"QueryCompatibleHostForNewDvsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8763,9 +9563,29 @@ func QueryCompatibleHostForNewDvs(ctx context.Context, r soap.RoundTripper, req return resBody.Res, nil } +type QueryCompatibleVmnicsFromHostsBody struct { + Req *types.QueryCompatibleVmnicsFromHosts `xml:"urn:vim25 QueryCompatibleVmnicsFromHosts,omitempty"` + Res *types.QueryCompatibleVmnicsFromHostsResponse `xml:"QueryCompatibleVmnicsFromHostsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryCompatibleVmnicsFromHostsBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryCompatibleVmnicsFromHosts(ctx context.Context, r soap.RoundTripper, req *types.QueryCompatibleVmnicsFromHosts) (*types.QueryCompatibleVmnicsFromHostsResponse, error) { + var reqBody, resBody QueryCompatibleVmnicsFromHostsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type QueryComplianceStatusBody struct { Req *types.QueryComplianceStatus `xml:"urn:vim25 QueryComplianceStatus,omitempty"` - Res *types.QueryComplianceStatusResponse `xml:"urn:vim25 QueryComplianceStatusResponse,omitempty"` + Res *types.QueryComplianceStatusResponse `xml:"QueryComplianceStatusResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8785,7 +9605,7 @@ func QueryComplianceStatus(ctx context.Context, r soap.RoundTripper, req *types. type QueryConfigOptionBody struct { Req *types.QueryConfigOption `xml:"urn:vim25 QueryConfigOption,omitempty"` - Res *types.QueryConfigOptionResponse `xml:"urn:vim25 QueryConfigOptionResponse,omitempty"` + Res *types.QueryConfigOptionResponse `xml:"QueryConfigOptionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8805,7 +9625,7 @@ func QueryConfigOption(ctx context.Context, r soap.RoundTripper, req *types.Quer type QueryConfigOptionDescriptorBody struct { Req *types.QueryConfigOptionDescriptor `xml:"urn:vim25 QueryConfigOptionDescriptor,omitempty"` - Res *types.QueryConfigOptionDescriptorResponse `xml:"urn:vim25 QueryConfigOptionDescriptorResponse,omitempty"` + Res *types.QueryConfigOptionDescriptorResponse `xml:"QueryConfigOptionDescriptorResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8825,7 +9645,7 @@ func QueryConfigOptionDescriptor(ctx context.Context, r soap.RoundTripper, req * type QueryConfigOptionExBody struct { Req *types.QueryConfigOptionEx `xml:"urn:vim25 QueryConfigOptionEx,omitempty"` - Res *types.QueryConfigOptionExResponse `xml:"urn:vim25 QueryConfigOptionExResponse,omitempty"` + Res *types.QueryConfigOptionExResponse `xml:"QueryConfigOptionExResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8845,7 +9665,7 @@ func QueryConfigOptionEx(ctx context.Context, r soap.RoundTripper, req *types.Qu type QueryConfigTargetBody struct { Req *types.QueryConfigTarget `xml:"urn:vim25 QueryConfigTarget,omitempty"` - Res *types.QueryConfigTargetResponse `xml:"urn:vim25 QueryConfigTargetResponse,omitempty"` + Res *types.QueryConfigTargetResponse `xml:"QueryConfigTargetResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8865,7 +9685,7 @@ func QueryConfigTarget(ctx context.Context, r soap.RoundTripper, req *types.Quer type QueryConfiguredModuleOptionStringBody struct { Req *types.QueryConfiguredModuleOptionString `xml:"urn:vim25 QueryConfiguredModuleOptionString,omitempty"` - Res *types.QueryConfiguredModuleOptionStringResponse `xml:"urn:vim25 QueryConfiguredModuleOptionStringResponse,omitempty"` + Res *types.QueryConfiguredModuleOptionStringResponse `xml:"QueryConfiguredModuleOptionStringResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8885,7 +9705,7 @@ func QueryConfiguredModuleOptionString(ctx context.Context, r soap.RoundTripper, type QueryConnectionInfoBody struct { Req *types.QueryConnectionInfo `xml:"urn:vim25 QueryConnectionInfo,omitempty"` - Res *types.QueryConnectionInfoResponse `xml:"urn:vim25 QueryConnectionInfoResponse,omitempty"` + Res *types.QueryConnectionInfoResponse `xml:"QueryConnectionInfoResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8905,7 +9725,7 @@ func QueryConnectionInfo(ctx context.Context, r soap.RoundTripper, req *types.Qu type QueryConnectionInfoViaSpecBody struct { Req *types.QueryConnectionInfoViaSpec `xml:"urn:vim25 QueryConnectionInfoViaSpec,omitempty"` - Res *types.QueryConnectionInfoViaSpecResponse `xml:"urn:vim25 QueryConnectionInfoViaSpecResponse,omitempty"` + Res *types.QueryConnectionInfoViaSpecResponse `xml:"QueryConnectionInfoViaSpecResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8923,9 +9743,49 @@ 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"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryCryptoKeyStatusBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryCryptoKeyStatus(ctx context.Context, r soap.RoundTripper, req *types.QueryCryptoKeyStatus) (*types.QueryCryptoKeyStatusResponse, error) { + var reqBody, resBody QueryCryptoKeyStatusBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type QueryDatastorePerformanceSummaryBody struct { Req *types.QueryDatastorePerformanceSummary `xml:"urn:vim25 QueryDatastorePerformanceSummary,omitempty"` - Res *types.QueryDatastorePerformanceSummaryResponse `xml:"urn:vim25 QueryDatastorePerformanceSummaryResponse,omitempty"` + Res *types.QueryDatastorePerformanceSummaryResponse `xml:"QueryDatastorePerformanceSummaryResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8945,7 +9805,7 @@ func QueryDatastorePerformanceSummary(ctx context.Context, r soap.RoundTripper, type QueryDateTimeBody struct { Req *types.QueryDateTime `xml:"urn:vim25 QueryDateTime,omitempty"` - Res *types.QueryDateTimeResponse `xml:"urn:vim25 QueryDateTimeResponse,omitempty"` + Res *types.QueryDateTimeResponse `xml:"QueryDateTimeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8965,7 +9825,7 @@ func QueryDateTime(ctx context.Context, r soap.RoundTripper, req *types.QueryDat type QueryDescriptionsBody struct { Req *types.QueryDescriptions `xml:"urn:vim25 QueryDescriptions,omitempty"` - Res *types.QueryDescriptionsResponse `xml:"urn:vim25 QueryDescriptionsResponse,omitempty"` + Res *types.QueryDescriptionsResponse `xml:"QueryDescriptionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -8985,7 +9845,7 @@ func QueryDescriptions(ctx context.Context, r soap.RoundTripper, req *types.Quer type QueryDisksForVsanBody struct { Req *types.QueryDisksForVsan `xml:"urn:vim25 QueryDisksForVsan,omitempty"` - Res *types.QueryDisksForVsanResponse `xml:"urn:vim25 QueryDisksForVsanResponse,omitempty"` + Res *types.QueryDisksForVsanResponse `xml:"QueryDisksForVsanResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9005,7 +9865,7 @@ func QueryDisksForVsan(ctx context.Context, r soap.RoundTripper, req *types.Quer type QueryDisksUsingFilterBody struct { Req *types.QueryDisksUsingFilter `xml:"urn:vim25 QueryDisksUsingFilter,omitempty"` - Res *types.QueryDisksUsingFilterResponse `xml:"urn:vim25 QueryDisksUsingFilterResponse,omitempty"` + Res *types.QueryDisksUsingFilterResponse `xml:"QueryDisksUsingFilterResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9025,7 +9885,7 @@ func QueryDisksUsingFilter(ctx context.Context, r soap.RoundTripper, req *types. type QueryDvsByUuidBody struct { Req *types.QueryDvsByUuid `xml:"urn:vim25 QueryDvsByUuid,omitempty"` - Res *types.QueryDvsByUuidResponse `xml:"urn:vim25 QueryDvsByUuidResponse,omitempty"` + Res *types.QueryDvsByUuidResponse `xml:"QueryDvsByUuidResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9045,7 +9905,7 @@ func QueryDvsByUuid(ctx context.Context, r soap.RoundTripper, req *types.QueryDv type QueryDvsCheckCompatibilityBody struct { Req *types.QueryDvsCheckCompatibility `xml:"urn:vim25 QueryDvsCheckCompatibility,omitempty"` - Res *types.QueryDvsCheckCompatibilityResponse `xml:"urn:vim25 QueryDvsCheckCompatibilityResponse,omitempty"` + Res *types.QueryDvsCheckCompatibilityResponse `xml:"QueryDvsCheckCompatibilityResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9065,7 +9925,7 @@ func QueryDvsCheckCompatibility(ctx context.Context, r soap.RoundTripper, req *t type QueryDvsCompatibleHostSpecBody struct { Req *types.QueryDvsCompatibleHostSpec `xml:"urn:vim25 QueryDvsCompatibleHostSpec,omitempty"` - Res *types.QueryDvsCompatibleHostSpecResponse `xml:"urn:vim25 QueryDvsCompatibleHostSpecResponse,omitempty"` + Res *types.QueryDvsCompatibleHostSpecResponse `xml:"QueryDvsCompatibleHostSpecResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9085,7 +9945,7 @@ func QueryDvsCompatibleHostSpec(ctx context.Context, r soap.RoundTripper, req *t type QueryDvsConfigTargetBody struct { Req *types.QueryDvsConfigTarget `xml:"urn:vim25 QueryDvsConfigTarget,omitempty"` - Res *types.QueryDvsConfigTargetResponse `xml:"urn:vim25 QueryDvsConfigTargetResponse,omitempty"` + Res *types.QueryDvsConfigTargetResponse `xml:"QueryDvsConfigTargetResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9105,7 +9965,7 @@ func QueryDvsConfigTarget(ctx context.Context, r soap.RoundTripper, req *types.Q type QueryDvsFeatureCapabilityBody struct { Req *types.QueryDvsFeatureCapability `xml:"urn:vim25 QueryDvsFeatureCapability,omitempty"` - Res *types.QueryDvsFeatureCapabilityResponse `xml:"urn:vim25 QueryDvsFeatureCapabilityResponse,omitempty"` + Res *types.QueryDvsFeatureCapabilityResponse `xml:"QueryDvsFeatureCapabilityResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9125,7 +9985,7 @@ func QueryDvsFeatureCapability(ctx context.Context, r soap.RoundTripper, req *ty type QueryEventsBody struct { Req *types.QueryEvents `xml:"urn:vim25 QueryEvents,omitempty"` - Res *types.QueryEventsResponse `xml:"urn:vim25 QueryEventsResponse,omitempty"` + Res *types.QueryEventsResponse `xml:"QueryEventsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9145,7 +10005,7 @@ func QueryEvents(ctx context.Context, r soap.RoundTripper, req *types.QueryEvent type QueryExpressionMetadataBody struct { Req *types.QueryExpressionMetadata `xml:"urn:vim25 QueryExpressionMetadata,omitempty"` - Res *types.QueryExpressionMetadataResponse `xml:"urn:vim25 QueryExpressionMetadataResponse,omitempty"` + Res *types.QueryExpressionMetadataResponse `xml:"QueryExpressionMetadataResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9165,7 +10025,7 @@ func QueryExpressionMetadata(ctx context.Context, r soap.RoundTripper, req *type type QueryExtensionIpAllocationUsageBody struct { Req *types.QueryExtensionIpAllocationUsage `xml:"urn:vim25 QueryExtensionIpAllocationUsage,omitempty"` - Res *types.QueryExtensionIpAllocationUsageResponse `xml:"urn:vim25 QueryExtensionIpAllocationUsageResponse,omitempty"` + Res *types.QueryExtensionIpAllocationUsageResponse `xml:"QueryExtensionIpAllocationUsageResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9185,7 +10045,7 @@ func QueryExtensionIpAllocationUsage(ctx context.Context, r soap.RoundTripper, r type QueryFaultToleranceCompatibilityBody struct { Req *types.QueryFaultToleranceCompatibility `xml:"urn:vim25 QueryFaultToleranceCompatibility,omitempty"` - Res *types.QueryFaultToleranceCompatibilityResponse `xml:"urn:vim25 QueryFaultToleranceCompatibilityResponse,omitempty"` + Res *types.QueryFaultToleranceCompatibilityResponse `xml:"QueryFaultToleranceCompatibilityResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9205,7 +10065,7 @@ func QueryFaultToleranceCompatibility(ctx context.Context, r soap.RoundTripper, type QueryFaultToleranceCompatibilityExBody struct { Req *types.QueryFaultToleranceCompatibilityEx `xml:"urn:vim25 QueryFaultToleranceCompatibilityEx,omitempty"` - Res *types.QueryFaultToleranceCompatibilityExResponse `xml:"urn:vim25 QueryFaultToleranceCompatibilityExResponse,omitempty"` + Res *types.QueryFaultToleranceCompatibilityExResponse `xml:"QueryFaultToleranceCompatibilityExResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9225,7 +10085,7 @@ func QueryFaultToleranceCompatibilityEx(ctx context.Context, r soap.RoundTripper type QueryFilterEntitiesBody struct { Req *types.QueryFilterEntities `xml:"urn:vim25 QueryFilterEntities,omitempty"` - Res *types.QueryFilterEntitiesResponse `xml:"urn:vim25 QueryFilterEntitiesResponse,omitempty"` + Res *types.QueryFilterEntitiesResponse `xml:"QueryFilterEntitiesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9245,7 +10105,7 @@ func QueryFilterEntities(ctx context.Context, r soap.RoundTripper, req *types.Qu type QueryFilterInfoIdsBody struct { Req *types.QueryFilterInfoIds `xml:"urn:vim25 QueryFilterInfoIds,omitempty"` - Res *types.QueryFilterInfoIdsResponse `xml:"urn:vim25 QueryFilterInfoIdsResponse,omitempty"` + Res *types.QueryFilterInfoIdsResponse `xml:"QueryFilterInfoIdsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9265,7 +10125,7 @@ func QueryFilterInfoIds(ctx context.Context, r soap.RoundTripper, req *types.Que type QueryFilterListBody struct { Req *types.QueryFilterList `xml:"urn:vim25 QueryFilterList,omitempty"` - Res *types.QueryFilterListResponse `xml:"urn:vim25 QueryFilterListResponse,omitempty"` + Res *types.QueryFilterListResponse `xml:"QueryFilterListResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9285,7 +10145,7 @@ func QueryFilterList(ctx context.Context, r soap.RoundTripper, req *types.QueryF type QueryFilterNameBody struct { Req *types.QueryFilterName `xml:"urn:vim25 QueryFilterName,omitempty"` - Res *types.QueryFilterNameResponse `xml:"urn:vim25 QueryFilterNameResponse,omitempty"` + Res *types.QueryFilterNameResponse `xml:"QueryFilterNameResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9305,7 +10165,7 @@ func QueryFilterName(ctx context.Context, r soap.RoundTripper, req *types.QueryF type QueryFirmwareConfigUploadURLBody struct { Req *types.QueryFirmwareConfigUploadURL `xml:"urn:vim25 QueryFirmwareConfigUploadURL,omitempty"` - Res *types.QueryFirmwareConfigUploadURLResponse `xml:"urn:vim25 QueryFirmwareConfigUploadURLResponse,omitempty"` + Res *types.QueryFirmwareConfigUploadURLResponse `xml:"QueryFirmwareConfigUploadURLResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9325,7 +10185,7 @@ func QueryFirmwareConfigUploadURL(ctx context.Context, r soap.RoundTripper, req type QueryHealthUpdateInfosBody struct { Req *types.QueryHealthUpdateInfos `xml:"urn:vim25 QueryHealthUpdateInfos,omitempty"` - Res *types.QueryHealthUpdateInfosResponse `xml:"urn:vim25 QueryHealthUpdateInfosResponse,omitempty"` + Res *types.QueryHealthUpdateInfosResponse `xml:"QueryHealthUpdateInfosResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9345,7 +10205,7 @@ func QueryHealthUpdateInfos(ctx context.Context, r soap.RoundTripper, req *types type QueryHealthUpdatesBody struct { Req *types.QueryHealthUpdates `xml:"urn:vim25 QueryHealthUpdates,omitempty"` - Res *types.QueryHealthUpdatesResponse `xml:"urn:vim25 QueryHealthUpdatesResponse,omitempty"` + Res *types.QueryHealthUpdatesResponse `xml:"QueryHealthUpdatesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9365,7 +10225,7 @@ func QueryHealthUpdates(ctx context.Context, r soap.RoundTripper, req *types.Que type QueryHostConnectionInfoBody struct { Req *types.QueryHostConnectionInfo `xml:"urn:vim25 QueryHostConnectionInfo,omitempty"` - Res *types.QueryHostConnectionInfoResponse `xml:"urn:vim25 QueryHostConnectionInfoResponse,omitempty"` + Res *types.QueryHostConnectionInfoResponse `xml:"QueryHostConnectionInfoResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9385,7 +10245,7 @@ func QueryHostConnectionInfo(ctx context.Context, r soap.RoundTripper, req *type type QueryHostPatch_TaskBody struct { Req *types.QueryHostPatch_Task `xml:"urn:vim25 QueryHostPatch_Task,omitempty"` - Res *types.QueryHostPatch_TaskResponse `xml:"urn:vim25 QueryHostPatch_TaskResponse,omitempty"` + Res *types.QueryHostPatch_TaskResponse `xml:"QueryHostPatch_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9405,7 +10265,7 @@ func QueryHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.Qu type QueryHostProfileMetadataBody struct { Req *types.QueryHostProfileMetadata `xml:"urn:vim25 QueryHostProfileMetadata,omitempty"` - Res *types.QueryHostProfileMetadataResponse `xml:"urn:vim25 QueryHostProfileMetadataResponse,omitempty"` + Res *types.QueryHostProfileMetadataResponse `xml:"QueryHostProfileMetadataResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9425,7 +10285,7 @@ func QueryHostProfileMetadata(ctx context.Context, r soap.RoundTripper, req *typ type QueryHostStatusBody struct { Req *types.QueryHostStatus `xml:"urn:vim25 QueryHostStatus,omitempty"` - Res *types.QueryHostStatusResponse `xml:"urn:vim25 QueryHostStatusResponse,omitempty"` + Res *types.QueryHostStatusResponse `xml:"QueryHostStatusResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9443,9 +10303,29 @@ func QueryHostStatus(ctx context.Context, r soap.RoundTripper, req *types.QueryH return resBody.Res, nil } +type QueryHostsWithAttachedLunBody struct { + Req *types.QueryHostsWithAttachedLun `xml:"urn:vim25 QueryHostsWithAttachedLun,omitempty"` + Res *types.QueryHostsWithAttachedLunResponse `xml:"QueryHostsWithAttachedLunResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryHostsWithAttachedLunBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryHostsWithAttachedLun(ctx context.Context, r soap.RoundTripper, req *types.QueryHostsWithAttachedLun) (*types.QueryHostsWithAttachedLunResponse, error) { + var reqBody, resBody QueryHostsWithAttachedLunBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type QueryIORMConfigOptionBody struct { Req *types.QueryIORMConfigOption `xml:"urn:vim25 QueryIORMConfigOption,omitempty"` - Res *types.QueryIORMConfigOptionResponse `xml:"urn:vim25 QueryIORMConfigOptionResponse,omitempty"` + Res *types.QueryIORMConfigOptionResponse `xml:"QueryIORMConfigOptionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9465,7 +10345,7 @@ func QueryIORMConfigOption(ctx context.Context, r soap.RoundTripper, req *types. type QueryIPAllocationsBody struct { Req *types.QueryIPAllocations `xml:"urn:vim25 QueryIPAllocations,omitempty"` - Res *types.QueryIPAllocationsResponse `xml:"urn:vim25 QueryIPAllocationsResponse,omitempty"` + Res *types.QueryIPAllocationsResponse `xml:"QueryIPAllocationsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9485,7 +10365,7 @@ func QueryIPAllocations(ctx context.Context, r soap.RoundTripper, req *types.Que type QueryIoFilterInfoBody struct { Req *types.QueryIoFilterInfo `xml:"urn:vim25 QueryIoFilterInfo,omitempty"` - Res *types.QueryIoFilterInfoResponse `xml:"urn:vim25 QueryIoFilterInfoResponse,omitempty"` + Res *types.QueryIoFilterInfoResponse `xml:"QueryIoFilterInfoResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9505,7 +10385,7 @@ func QueryIoFilterInfo(ctx context.Context, r soap.RoundTripper, req *types.Quer type QueryIoFilterIssuesBody struct { Req *types.QueryIoFilterIssues `xml:"urn:vim25 QueryIoFilterIssues,omitempty"` - Res *types.QueryIoFilterIssuesResponse `xml:"urn:vim25 QueryIoFilterIssuesResponse,omitempty"` + Res *types.QueryIoFilterIssuesResponse `xml:"QueryIoFilterIssuesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9525,7 +10405,7 @@ func QueryIoFilterIssues(ctx context.Context, r soap.RoundTripper, req *types.Qu type QueryIpPoolsBody struct { Req *types.QueryIpPools `xml:"urn:vim25 QueryIpPools,omitempty"` - Res *types.QueryIpPoolsResponse `xml:"urn:vim25 QueryIpPoolsResponse,omitempty"` + Res *types.QueryIpPoolsResponse `xml:"QueryIpPoolsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9545,7 +10425,7 @@ func QueryIpPools(ctx context.Context, r soap.RoundTripper, req *types.QueryIpPo type QueryLicenseSourceAvailabilityBody struct { Req *types.QueryLicenseSourceAvailability `xml:"urn:vim25 QueryLicenseSourceAvailability,omitempty"` - Res *types.QueryLicenseSourceAvailabilityResponse `xml:"urn:vim25 QueryLicenseSourceAvailabilityResponse,omitempty"` + Res *types.QueryLicenseSourceAvailabilityResponse `xml:"QueryLicenseSourceAvailabilityResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9565,7 +10445,7 @@ func QueryLicenseSourceAvailability(ctx context.Context, r soap.RoundTripper, re type QueryLicenseUsageBody struct { Req *types.QueryLicenseUsage `xml:"urn:vim25 QueryLicenseUsage,omitempty"` - Res *types.QueryLicenseUsageResponse `xml:"urn:vim25 QueryLicenseUsageResponse,omitempty"` + Res *types.QueryLicenseUsageResponse `xml:"QueryLicenseUsageResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9585,7 +10465,7 @@ func QueryLicenseUsage(ctx context.Context, r soap.RoundTripper, req *types.Quer type QueryLockdownExceptionsBody struct { Req *types.QueryLockdownExceptions `xml:"urn:vim25 QueryLockdownExceptions,omitempty"` - Res *types.QueryLockdownExceptionsResponse `xml:"urn:vim25 QueryLockdownExceptionsResponse,omitempty"` + Res *types.QueryLockdownExceptionsResponse `xml:"QueryLockdownExceptionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9605,7 +10485,7 @@ func QueryLockdownExceptions(ctx context.Context, r soap.RoundTripper, req *type type QueryManagedByBody struct { Req *types.QueryManagedBy `xml:"urn:vim25 QueryManagedBy,omitempty"` - Res *types.QueryManagedByResponse `xml:"urn:vim25 QueryManagedByResponse,omitempty"` + Res *types.QueryManagedByResponse `xml:"QueryManagedByResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9623,9 +10503,29 @@ func QueryManagedBy(ctx context.Context, r soap.RoundTripper, req *types.QueryMa return resBody.Res, nil } +type QueryMaxQueueDepthBody struct { + Req *types.QueryMaxQueueDepth `xml:"urn:vim25 QueryMaxQueueDepth,omitempty"` + Res *types.QueryMaxQueueDepthResponse `xml:"QueryMaxQueueDepthResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryMaxQueueDepthBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryMaxQueueDepth(ctx context.Context, r soap.RoundTripper, req *types.QueryMaxQueueDepth) (*types.QueryMaxQueueDepthResponse, error) { + var reqBody, resBody QueryMaxQueueDepthBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type QueryMemoryOverheadBody struct { Req *types.QueryMemoryOverhead `xml:"urn:vim25 QueryMemoryOverhead,omitempty"` - Res *types.QueryMemoryOverheadResponse `xml:"urn:vim25 QueryMemoryOverheadResponse,omitempty"` + Res *types.QueryMemoryOverheadResponse `xml:"QueryMemoryOverheadResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9645,7 +10545,7 @@ func QueryMemoryOverhead(ctx context.Context, r soap.RoundTripper, req *types.Qu type QueryMemoryOverheadExBody struct { Req *types.QueryMemoryOverheadEx `xml:"urn:vim25 QueryMemoryOverheadEx,omitempty"` - Res *types.QueryMemoryOverheadExResponse `xml:"urn:vim25 QueryMemoryOverheadExResponse,omitempty"` + Res *types.QueryMemoryOverheadExResponse `xml:"QueryMemoryOverheadExResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9665,7 +10565,7 @@ func QueryMemoryOverheadEx(ctx context.Context, r soap.RoundTripper, req *types. type QueryMigrationDependenciesBody struct { Req *types.QueryMigrationDependencies `xml:"urn:vim25 QueryMigrationDependencies,omitempty"` - Res *types.QueryMigrationDependenciesResponse `xml:"urn:vim25 QueryMigrationDependenciesResponse,omitempty"` + Res *types.QueryMigrationDependenciesResponse `xml:"QueryMigrationDependenciesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9685,7 +10585,7 @@ func QueryMigrationDependencies(ctx context.Context, r soap.RoundTripper, req *t type QueryModulesBody struct { Req *types.QueryModules `xml:"urn:vim25 QueryModules,omitempty"` - Res *types.QueryModulesResponse `xml:"urn:vim25 QueryModulesResponse,omitempty"` + Res *types.QueryModulesResponse `xml:"QueryModulesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9705,7 +10605,7 @@ func QueryModules(ctx context.Context, r soap.RoundTripper, req *types.QueryModu type QueryMonitoredEntitiesBody struct { Req *types.QueryMonitoredEntities `xml:"urn:vim25 QueryMonitoredEntities,omitempty"` - Res *types.QueryMonitoredEntitiesResponse `xml:"urn:vim25 QueryMonitoredEntitiesResponse,omitempty"` + Res *types.QueryMonitoredEntitiesResponse `xml:"QueryMonitoredEntitiesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9725,7 +10625,7 @@ func QueryMonitoredEntities(ctx context.Context, r soap.RoundTripper, req *types type QueryNFSUserBody struct { Req *types.QueryNFSUser `xml:"urn:vim25 QueryNFSUser,omitempty"` - Res *types.QueryNFSUserResponse `xml:"urn:vim25 QueryNFSUserResponse,omitempty"` + Res *types.QueryNFSUserResponse `xml:"QueryNFSUserResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9745,7 +10645,7 @@ func QueryNFSUser(ctx context.Context, r soap.RoundTripper, req *types.QueryNFSU type QueryNetConfigBody struct { Req *types.QueryNetConfig `xml:"urn:vim25 QueryNetConfig,omitempty"` - Res *types.QueryNetConfigResponse `xml:"urn:vim25 QueryNetConfigResponse,omitempty"` + Res *types.QueryNetConfigResponse `xml:"QueryNetConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9765,7 +10665,7 @@ func QueryNetConfig(ctx context.Context, r soap.RoundTripper, req *types.QueryNe type QueryNetworkHintBody struct { Req *types.QueryNetworkHint `xml:"urn:vim25 QueryNetworkHint,omitempty"` - Res *types.QueryNetworkHintResponse `xml:"urn:vim25 QueryNetworkHintResponse,omitempty"` + Res *types.QueryNetworkHintResponse `xml:"QueryNetworkHintResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9785,7 +10685,7 @@ func QueryNetworkHint(ctx context.Context, r soap.RoundTripper, req *types.Query type QueryObjectsOnPhysicalVsanDiskBody struct { Req *types.QueryObjectsOnPhysicalVsanDisk `xml:"urn:vim25 QueryObjectsOnPhysicalVsanDisk,omitempty"` - Res *types.QueryObjectsOnPhysicalVsanDiskResponse `xml:"urn:vim25 QueryObjectsOnPhysicalVsanDiskResponse,omitempty"` + Res *types.QueryObjectsOnPhysicalVsanDiskResponse `xml:"QueryObjectsOnPhysicalVsanDiskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9805,7 +10705,7 @@ func QueryObjectsOnPhysicalVsanDisk(ctx context.Context, r soap.RoundTripper, re type QueryOptionsBody struct { Req *types.QueryOptions `xml:"urn:vim25 QueryOptions,omitempty"` - Res *types.QueryOptionsResponse `xml:"urn:vim25 QueryOptionsResponse,omitempty"` + Res *types.QueryOptionsResponse `xml:"QueryOptionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9825,7 +10725,7 @@ func QueryOptions(ctx context.Context, r soap.RoundTripper, req *types.QueryOpti type QueryPartitionCreateDescBody struct { Req *types.QueryPartitionCreateDesc `xml:"urn:vim25 QueryPartitionCreateDesc,omitempty"` - Res *types.QueryPartitionCreateDescResponse `xml:"urn:vim25 QueryPartitionCreateDescResponse,omitempty"` + Res *types.QueryPartitionCreateDescResponse `xml:"QueryPartitionCreateDescResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9845,7 +10745,7 @@ func QueryPartitionCreateDesc(ctx context.Context, r soap.RoundTripper, req *typ type QueryPartitionCreateOptionsBody struct { Req *types.QueryPartitionCreateOptions `xml:"urn:vim25 QueryPartitionCreateOptions,omitempty"` - Res *types.QueryPartitionCreateOptionsResponse `xml:"urn:vim25 QueryPartitionCreateOptionsResponse,omitempty"` + Res *types.QueryPartitionCreateOptionsResponse `xml:"QueryPartitionCreateOptionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9865,7 +10765,7 @@ func QueryPartitionCreateOptions(ctx context.Context, r soap.RoundTripper, req * type QueryPathSelectionPolicyOptionsBody struct { Req *types.QueryPathSelectionPolicyOptions `xml:"urn:vim25 QueryPathSelectionPolicyOptions,omitempty"` - Res *types.QueryPathSelectionPolicyOptionsResponse `xml:"urn:vim25 QueryPathSelectionPolicyOptionsResponse,omitempty"` + Res *types.QueryPathSelectionPolicyOptionsResponse `xml:"QueryPathSelectionPolicyOptionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9885,7 +10785,7 @@ func QueryPathSelectionPolicyOptions(ctx context.Context, r soap.RoundTripper, r type QueryPerfBody struct { Req *types.QueryPerf `xml:"urn:vim25 QueryPerf,omitempty"` - Res *types.QueryPerfResponse `xml:"urn:vim25 QueryPerfResponse,omitempty"` + Res *types.QueryPerfResponse `xml:"QueryPerfResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9905,7 +10805,7 @@ func QueryPerf(ctx context.Context, r soap.RoundTripper, req *types.QueryPerf) ( type QueryPerfCompositeBody struct { Req *types.QueryPerfComposite `xml:"urn:vim25 QueryPerfComposite,omitempty"` - Res *types.QueryPerfCompositeResponse `xml:"urn:vim25 QueryPerfCompositeResponse,omitempty"` + Res *types.QueryPerfCompositeResponse `xml:"QueryPerfCompositeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9925,7 +10825,7 @@ func QueryPerfComposite(ctx context.Context, r soap.RoundTripper, req *types.Que type QueryPerfCounterBody struct { Req *types.QueryPerfCounter `xml:"urn:vim25 QueryPerfCounter,omitempty"` - Res *types.QueryPerfCounterResponse `xml:"urn:vim25 QueryPerfCounterResponse,omitempty"` + Res *types.QueryPerfCounterResponse `xml:"QueryPerfCounterResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9945,7 +10845,7 @@ func QueryPerfCounter(ctx context.Context, r soap.RoundTripper, req *types.Query type QueryPerfCounterByLevelBody struct { Req *types.QueryPerfCounterByLevel `xml:"urn:vim25 QueryPerfCounterByLevel,omitempty"` - Res *types.QueryPerfCounterByLevelResponse `xml:"urn:vim25 QueryPerfCounterByLevelResponse,omitempty"` + Res *types.QueryPerfCounterByLevelResponse `xml:"QueryPerfCounterByLevelResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9965,7 +10865,7 @@ func QueryPerfCounterByLevel(ctx context.Context, r soap.RoundTripper, req *type type QueryPerfProviderSummaryBody struct { Req *types.QueryPerfProviderSummary `xml:"urn:vim25 QueryPerfProviderSummary,omitempty"` - Res *types.QueryPerfProviderSummaryResponse `xml:"urn:vim25 QueryPerfProviderSummaryResponse,omitempty"` + Res *types.QueryPerfProviderSummaryResponse `xml:"QueryPerfProviderSummaryResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -9985,7 +10885,7 @@ func QueryPerfProviderSummary(ctx context.Context, r soap.RoundTripper, req *typ type QueryPhysicalVsanDisksBody struct { Req *types.QueryPhysicalVsanDisks `xml:"urn:vim25 QueryPhysicalVsanDisks,omitempty"` - Res *types.QueryPhysicalVsanDisksResponse `xml:"urn:vim25 QueryPhysicalVsanDisksResponse,omitempty"` + Res *types.QueryPhysicalVsanDisksResponse `xml:"QueryPhysicalVsanDisksResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10005,7 +10905,7 @@ func QueryPhysicalVsanDisks(ctx context.Context, r soap.RoundTripper, req *types type QueryPnicStatusBody struct { Req *types.QueryPnicStatus `xml:"urn:vim25 QueryPnicStatus,omitempty"` - Res *types.QueryPnicStatusResponse `xml:"urn:vim25 QueryPnicStatusResponse,omitempty"` + Res *types.QueryPnicStatusResponse `xml:"QueryPnicStatusResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10025,7 +10925,7 @@ func QueryPnicStatus(ctx context.Context, r soap.RoundTripper, req *types.QueryP type QueryPolicyMetadataBody struct { Req *types.QueryPolicyMetadata `xml:"urn:vim25 QueryPolicyMetadata,omitempty"` - Res *types.QueryPolicyMetadataResponse `xml:"urn:vim25 QueryPolicyMetadataResponse,omitempty"` + Res *types.QueryPolicyMetadataResponse `xml:"QueryPolicyMetadataResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10043,9 +10943,29 @@ func QueryPolicyMetadata(ctx context.Context, r soap.RoundTripper, req *types.Qu return resBody.Res, nil } +type QueryProductLockerLocationBody struct { + Req *types.QueryProductLockerLocation `xml:"urn:vim25 QueryProductLockerLocation,omitempty"` + Res *types.QueryProductLockerLocationResponse `xml:"QueryProductLockerLocationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QueryProductLockerLocationBody) Fault() *soap.Fault { return b.Fault_ } + +func QueryProductLockerLocation(ctx context.Context, r soap.RoundTripper, req *types.QueryProductLockerLocation) (*types.QueryProductLockerLocationResponse, error) { + var reqBody, resBody QueryProductLockerLocationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type QueryProfileStructureBody struct { Req *types.QueryProfileStructure `xml:"urn:vim25 QueryProfileStructure,omitempty"` - Res *types.QueryProfileStructureResponse `xml:"urn:vim25 QueryProfileStructureResponse,omitempty"` + Res *types.QueryProfileStructureResponse `xml:"QueryProfileStructureResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10065,7 +10985,7 @@ func QueryProfileStructure(ctx context.Context, r soap.RoundTripper, req *types. type QueryProviderListBody struct { Req *types.QueryProviderList `xml:"urn:vim25 QueryProviderList,omitempty"` - Res *types.QueryProviderListResponse `xml:"urn:vim25 QueryProviderListResponse,omitempty"` + Res *types.QueryProviderListResponse `xml:"QueryProviderListResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10085,7 +11005,7 @@ func QueryProviderList(ctx context.Context, r soap.RoundTripper, req *types.Quer type QueryProviderNameBody struct { Req *types.QueryProviderName `xml:"urn:vim25 QueryProviderName,omitempty"` - Res *types.QueryProviderNameResponse `xml:"urn:vim25 QueryProviderNameResponse,omitempty"` + Res *types.QueryProviderNameResponse `xml:"QueryProviderNameResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10105,7 +11025,7 @@ func QueryProviderName(ctx context.Context, r soap.RoundTripper, req *types.Quer type QueryResourceConfigOptionBody struct { Req *types.QueryResourceConfigOption `xml:"urn:vim25 QueryResourceConfigOption,omitempty"` - Res *types.QueryResourceConfigOptionResponse `xml:"urn:vim25 QueryResourceConfigOptionResponse,omitempty"` + Res *types.QueryResourceConfigOptionResponse `xml:"QueryResourceConfigOptionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10125,7 +11045,7 @@ func QueryResourceConfigOption(ctx context.Context, r soap.RoundTripper, req *ty type QueryServiceListBody struct { Req *types.QueryServiceList `xml:"urn:vim25 QueryServiceList,omitempty"` - Res *types.QueryServiceListResponse `xml:"urn:vim25 QueryServiceListResponse,omitempty"` + Res *types.QueryServiceListResponse `xml:"QueryServiceListResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10145,7 +11065,7 @@ func QueryServiceList(ctx context.Context, r soap.RoundTripper, req *types.Query type QueryStorageArrayTypePolicyOptionsBody struct { Req *types.QueryStorageArrayTypePolicyOptions `xml:"urn:vim25 QueryStorageArrayTypePolicyOptions,omitempty"` - Res *types.QueryStorageArrayTypePolicyOptionsResponse `xml:"urn:vim25 QueryStorageArrayTypePolicyOptionsResponse,omitempty"` + Res *types.QueryStorageArrayTypePolicyOptionsResponse `xml:"QueryStorageArrayTypePolicyOptionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10165,7 +11085,7 @@ func QueryStorageArrayTypePolicyOptions(ctx context.Context, r soap.RoundTripper type QuerySupportedFeaturesBody struct { Req *types.QuerySupportedFeatures `xml:"urn:vim25 QuerySupportedFeatures,omitempty"` - Res *types.QuerySupportedFeaturesResponse `xml:"urn:vim25 QuerySupportedFeaturesResponse,omitempty"` + Res *types.QuerySupportedFeaturesResponse `xml:"QuerySupportedFeaturesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10183,9 +11103,29 @@ func QuerySupportedFeatures(ctx context.Context, r soap.RoundTripper, req *types return resBody.Res, nil } +type QuerySupportedNetworkOffloadSpecBody struct { + Req *types.QuerySupportedNetworkOffloadSpec `xml:"urn:vim25 QuerySupportedNetworkOffloadSpec,omitempty"` + Res *types.QuerySupportedNetworkOffloadSpecResponse `xml:"QuerySupportedNetworkOffloadSpecResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *QuerySupportedNetworkOffloadSpecBody) Fault() *soap.Fault { return b.Fault_ } + +func QuerySupportedNetworkOffloadSpec(ctx context.Context, r soap.RoundTripper, req *types.QuerySupportedNetworkOffloadSpec) (*types.QuerySupportedNetworkOffloadSpecResponse, error) { + var reqBody, resBody QuerySupportedNetworkOffloadSpecBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type QuerySyncingVsanObjectsBody struct { Req *types.QuerySyncingVsanObjects `xml:"urn:vim25 QuerySyncingVsanObjects,omitempty"` - Res *types.QuerySyncingVsanObjectsResponse `xml:"urn:vim25 QuerySyncingVsanObjectsResponse,omitempty"` + Res *types.QuerySyncingVsanObjectsResponse `xml:"QuerySyncingVsanObjectsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10205,7 +11145,7 @@ func QuerySyncingVsanObjects(ctx context.Context, r soap.RoundTripper, req *type type QuerySystemUsersBody struct { Req *types.QuerySystemUsers `xml:"urn:vim25 QuerySystemUsers,omitempty"` - Res *types.QuerySystemUsersResponse `xml:"urn:vim25 QuerySystemUsersResponse,omitempty"` + Res *types.QuerySystemUsersResponse `xml:"QuerySystemUsersResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10225,7 +11165,7 @@ func QuerySystemUsers(ctx context.Context, r soap.RoundTripper, req *types.Query type QueryTargetCapabilitiesBody struct { Req *types.QueryTargetCapabilities `xml:"urn:vim25 QueryTargetCapabilities,omitempty"` - Res *types.QueryTargetCapabilitiesResponse `xml:"urn:vim25 QueryTargetCapabilitiesResponse,omitempty"` + Res *types.QueryTargetCapabilitiesResponse `xml:"QueryTargetCapabilitiesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10245,7 +11185,7 @@ func QueryTargetCapabilities(ctx context.Context, r soap.RoundTripper, req *type type QueryTpmAttestationReportBody struct { Req *types.QueryTpmAttestationReport `xml:"urn:vim25 QueryTpmAttestationReport,omitempty"` - Res *types.QueryTpmAttestationReportResponse `xml:"urn:vim25 QueryTpmAttestationReportResponse,omitempty"` + Res *types.QueryTpmAttestationReportResponse `xml:"QueryTpmAttestationReportResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10265,7 +11205,7 @@ func QueryTpmAttestationReport(ctx context.Context, r soap.RoundTripper, req *ty type QueryUnmonitoredHostsBody struct { Req *types.QueryUnmonitoredHosts `xml:"urn:vim25 QueryUnmonitoredHosts,omitempty"` - Res *types.QueryUnmonitoredHostsResponse `xml:"urn:vim25 QueryUnmonitoredHostsResponse,omitempty"` + Res *types.QueryUnmonitoredHostsResponse `xml:"QueryUnmonitoredHostsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10285,7 +11225,7 @@ func QueryUnmonitoredHosts(ctx context.Context, r soap.RoundTripper, req *types. type QueryUnownedFilesBody struct { Req *types.QueryUnownedFiles `xml:"urn:vim25 QueryUnownedFiles,omitempty"` - Res *types.QueryUnownedFilesResponse `xml:"urn:vim25 QueryUnownedFilesResponse,omitempty"` + Res *types.QueryUnownedFilesResponse `xml:"QueryUnownedFilesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10305,7 +11245,7 @@ func QueryUnownedFiles(ctx context.Context, r soap.RoundTripper, req *types.Quer type QueryUnresolvedVmfsVolumeBody struct { Req *types.QueryUnresolvedVmfsVolume `xml:"urn:vim25 QueryUnresolvedVmfsVolume,omitempty"` - Res *types.QueryUnresolvedVmfsVolumeResponse `xml:"urn:vim25 QueryUnresolvedVmfsVolumeResponse,omitempty"` + Res *types.QueryUnresolvedVmfsVolumeResponse `xml:"QueryUnresolvedVmfsVolumeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10325,7 +11265,7 @@ func QueryUnresolvedVmfsVolume(ctx context.Context, r soap.RoundTripper, req *ty type QueryUnresolvedVmfsVolumesBody struct { Req *types.QueryUnresolvedVmfsVolumes `xml:"urn:vim25 QueryUnresolvedVmfsVolumes,omitempty"` - Res *types.QueryUnresolvedVmfsVolumesResponse `xml:"urn:vim25 QueryUnresolvedVmfsVolumesResponse,omitempty"` + Res *types.QueryUnresolvedVmfsVolumesResponse `xml:"QueryUnresolvedVmfsVolumesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10345,7 +11285,7 @@ func QueryUnresolvedVmfsVolumes(ctx context.Context, r soap.RoundTripper, req *t type QueryUsedVlanIdInDvsBody struct { Req *types.QueryUsedVlanIdInDvs `xml:"urn:vim25 QueryUsedVlanIdInDvs,omitempty"` - Res *types.QueryUsedVlanIdInDvsResponse `xml:"urn:vim25 QueryUsedVlanIdInDvsResponse,omitempty"` + Res *types.QueryUsedVlanIdInDvsResponse `xml:"QueryUsedVlanIdInDvsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10365,7 +11305,7 @@ func QueryUsedVlanIdInDvs(ctx context.Context, r soap.RoundTripper, req *types.Q type QueryVMotionCompatibilityBody struct { Req *types.QueryVMotionCompatibility `xml:"urn:vim25 QueryVMotionCompatibility,omitempty"` - Res *types.QueryVMotionCompatibilityResponse `xml:"urn:vim25 QueryVMotionCompatibilityResponse,omitempty"` + Res *types.QueryVMotionCompatibilityResponse `xml:"QueryVMotionCompatibilityResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10385,7 +11325,7 @@ func QueryVMotionCompatibility(ctx context.Context, r soap.RoundTripper, req *ty type QueryVMotionCompatibilityEx_TaskBody struct { Req *types.QueryVMotionCompatibilityEx_Task `xml:"urn:vim25 QueryVMotionCompatibilityEx_Task,omitempty"` - Res *types.QueryVMotionCompatibilityEx_TaskResponse `xml:"urn:vim25 QueryVMotionCompatibilityEx_TaskResponse,omitempty"` + Res *types.QueryVMotionCompatibilityEx_TaskResponse `xml:"QueryVMotionCompatibilityEx_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10405,7 +11345,7 @@ func QueryVMotionCompatibilityEx_Task(ctx context.Context, r soap.RoundTripper, type QueryVirtualDiskFragmentationBody struct { Req *types.QueryVirtualDiskFragmentation `xml:"urn:vim25 QueryVirtualDiskFragmentation,omitempty"` - Res *types.QueryVirtualDiskFragmentationResponse `xml:"urn:vim25 QueryVirtualDiskFragmentationResponse,omitempty"` + Res *types.QueryVirtualDiskFragmentationResponse `xml:"QueryVirtualDiskFragmentationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10425,7 +11365,7 @@ func QueryVirtualDiskFragmentation(ctx context.Context, r soap.RoundTripper, req type QueryVirtualDiskGeometryBody struct { Req *types.QueryVirtualDiskGeometry `xml:"urn:vim25 QueryVirtualDiskGeometry,omitempty"` - Res *types.QueryVirtualDiskGeometryResponse `xml:"urn:vim25 QueryVirtualDiskGeometryResponse,omitempty"` + Res *types.QueryVirtualDiskGeometryResponse `xml:"QueryVirtualDiskGeometryResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10445,7 +11385,7 @@ func QueryVirtualDiskGeometry(ctx context.Context, r soap.RoundTripper, req *typ type QueryVirtualDiskUuidBody struct { Req *types.QueryVirtualDiskUuid `xml:"urn:vim25 QueryVirtualDiskUuid,omitempty"` - Res *types.QueryVirtualDiskUuidResponse `xml:"urn:vim25 QueryVirtualDiskUuidResponse,omitempty"` + Res *types.QueryVirtualDiskUuidResponse `xml:"QueryVirtualDiskUuidResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10465,7 +11405,7 @@ func QueryVirtualDiskUuid(ctx context.Context, r soap.RoundTripper, req *types.Q type QueryVmfsConfigOptionBody struct { Req *types.QueryVmfsConfigOption `xml:"urn:vim25 QueryVmfsConfigOption,omitempty"` - Res *types.QueryVmfsConfigOptionResponse `xml:"urn:vim25 QueryVmfsConfigOptionResponse,omitempty"` + Res *types.QueryVmfsConfigOptionResponse `xml:"QueryVmfsConfigOptionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10485,7 +11425,7 @@ func QueryVmfsConfigOption(ctx context.Context, r soap.RoundTripper, req *types. type QueryVmfsDatastoreCreateOptionsBody struct { Req *types.QueryVmfsDatastoreCreateOptions `xml:"urn:vim25 QueryVmfsDatastoreCreateOptions,omitempty"` - Res *types.QueryVmfsDatastoreCreateOptionsResponse `xml:"urn:vim25 QueryVmfsDatastoreCreateOptionsResponse,omitempty"` + Res *types.QueryVmfsDatastoreCreateOptionsResponse `xml:"QueryVmfsDatastoreCreateOptionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10505,7 +11445,7 @@ func QueryVmfsDatastoreCreateOptions(ctx context.Context, r soap.RoundTripper, r type QueryVmfsDatastoreExpandOptionsBody struct { Req *types.QueryVmfsDatastoreExpandOptions `xml:"urn:vim25 QueryVmfsDatastoreExpandOptions,omitempty"` - Res *types.QueryVmfsDatastoreExpandOptionsResponse `xml:"urn:vim25 QueryVmfsDatastoreExpandOptionsResponse,omitempty"` + Res *types.QueryVmfsDatastoreExpandOptionsResponse `xml:"QueryVmfsDatastoreExpandOptionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10525,7 +11465,7 @@ func QueryVmfsDatastoreExpandOptions(ctx context.Context, r soap.RoundTripper, r type QueryVmfsDatastoreExtendOptionsBody struct { Req *types.QueryVmfsDatastoreExtendOptions `xml:"urn:vim25 QueryVmfsDatastoreExtendOptions,omitempty"` - Res *types.QueryVmfsDatastoreExtendOptionsResponse `xml:"urn:vim25 QueryVmfsDatastoreExtendOptionsResponse,omitempty"` + Res *types.QueryVmfsDatastoreExtendOptionsResponse `xml:"QueryVmfsDatastoreExtendOptionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10545,7 +11485,7 @@ func QueryVmfsDatastoreExtendOptions(ctx context.Context, r soap.RoundTripper, r type QueryVnicStatusBody struct { Req *types.QueryVnicStatus `xml:"urn:vim25 QueryVnicStatus,omitempty"` - Res *types.QueryVnicStatusResponse `xml:"urn:vim25 QueryVnicStatusResponse,omitempty"` + Res *types.QueryVnicStatusResponse `xml:"QueryVnicStatusResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10565,7 +11505,7 @@ func QueryVnicStatus(ctx context.Context, r soap.RoundTripper, req *types.QueryV type QueryVsanObjectUuidsByFilterBody struct { Req *types.QueryVsanObjectUuidsByFilter `xml:"urn:vim25 QueryVsanObjectUuidsByFilter,omitempty"` - Res *types.QueryVsanObjectUuidsByFilterResponse `xml:"urn:vim25 QueryVsanObjectUuidsByFilterResponse,omitempty"` + Res *types.QueryVsanObjectUuidsByFilterResponse `xml:"QueryVsanObjectUuidsByFilterResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10585,7 +11525,7 @@ func QueryVsanObjectUuidsByFilter(ctx context.Context, r soap.RoundTripper, req type QueryVsanObjectsBody struct { Req *types.QueryVsanObjects `xml:"urn:vim25 QueryVsanObjects,omitempty"` - Res *types.QueryVsanObjectsResponse `xml:"urn:vim25 QueryVsanObjectsResponse,omitempty"` + Res *types.QueryVsanObjectsResponse `xml:"QueryVsanObjectsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10605,7 +11545,7 @@ func QueryVsanObjects(ctx context.Context, r soap.RoundTripper, req *types.Query type QueryVsanStatisticsBody struct { Req *types.QueryVsanStatistics `xml:"urn:vim25 QueryVsanStatistics,omitempty"` - Res *types.QueryVsanStatisticsResponse `xml:"urn:vim25 QueryVsanStatisticsResponse,omitempty"` + Res *types.QueryVsanStatisticsResponse `xml:"QueryVsanStatisticsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10625,7 +11565,7 @@ func QueryVsanStatistics(ctx context.Context, r soap.RoundTripper, req *types.Qu type QueryVsanUpgradeStatusBody struct { Req *types.QueryVsanUpgradeStatus `xml:"urn:vim25 QueryVsanUpgradeStatus,omitempty"` - Res *types.QueryVsanUpgradeStatusResponse `xml:"urn:vim25 QueryVsanUpgradeStatusResponse,omitempty"` + Res *types.QueryVsanUpgradeStatusResponse `xml:"QueryVsanUpgradeStatusResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10645,7 +11585,7 @@ func QueryVsanUpgradeStatus(ctx context.Context, r soap.RoundTripper, req *types type ReadEnvironmentVariableInGuestBody struct { Req *types.ReadEnvironmentVariableInGuest `xml:"urn:vim25 ReadEnvironmentVariableInGuest,omitempty"` - Res *types.ReadEnvironmentVariableInGuestResponse `xml:"urn:vim25 ReadEnvironmentVariableInGuestResponse,omitempty"` + Res *types.ReadEnvironmentVariableInGuestResponse `xml:"ReadEnvironmentVariableInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10665,7 +11605,7 @@ func ReadEnvironmentVariableInGuest(ctx context.Context, r soap.RoundTripper, re type ReadNextEventsBody struct { Req *types.ReadNextEvents `xml:"urn:vim25 ReadNextEvents,omitempty"` - Res *types.ReadNextEventsResponse `xml:"urn:vim25 ReadNextEventsResponse,omitempty"` + Res *types.ReadNextEventsResponse `xml:"ReadNextEventsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10685,7 +11625,7 @@ func ReadNextEvents(ctx context.Context, r soap.RoundTripper, req *types.ReadNex type ReadNextTasksBody struct { Req *types.ReadNextTasks `xml:"urn:vim25 ReadNextTasks,omitempty"` - Res *types.ReadNextTasksResponse `xml:"urn:vim25 ReadNextTasksResponse,omitempty"` + Res *types.ReadNextTasksResponse `xml:"ReadNextTasksResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10705,7 +11645,7 @@ func ReadNextTasks(ctx context.Context, r soap.RoundTripper, req *types.ReadNext type ReadPreviousEventsBody struct { Req *types.ReadPreviousEvents `xml:"urn:vim25 ReadPreviousEvents,omitempty"` - Res *types.ReadPreviousEventsResponse `xml:"urn:vim25 ReadPreviousEventsResponse,omitempty"` + Res *types.ReadPreviousEventsResponse `xml:"ReadPreviousEventsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10725,7 +11665,7 @@ func ReadPreviousEvents(ctx context.Context, r soap.RoundTripper, req *types.Rea type ReadPreviousTasksBody struct { Req *types.ReadPreviousTasks `xml:"urn:vim25 ReadPreviousTasks,omitempty"` - Res *types.ReadPreviousTasksResponse `xml:"urn:vim25 ReadPreviousTasksResponse,omitempty"` + Res *types.ReadPreviousTasksResponse `xml:"ReadPreviousTasksResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10745,7 +11685,7 @@ func ReadPreviousTasks(ctx context.Context, r soap.RoundTripper, req *types.Read type RebootGuestBody struct { Req *types.RebootGuest `xml:"urn:vim25 RebootGuest,omitempty"` - Res *types.RebootGuestResponse `xml:"urn:vim25 RebootGuestResponse,omitempty"` + Res *types.RebootGuestResponse `xml:"RebootGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10765,7 +11705,7 @@ func RebootGuest(ctx context.Context, r soap.RoundTripper, req *types.RebootGues type RebootHost_TaskBody struct { Req *types.RebootHost_Task `xml:"urn:vim25 RebootHost_Task,omitempty"` - Res *types.RebootHost_TaskResponse `xml:"urn:vim25 RebootHost_TaskResponse,omitempty"` + Res *types.RebootHost_TaskResponse `xml:"RebootHost_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10785,7 +11725,7 @@ func RebootHost_Task(ctx context.Context, r soap.RoundTripper, req *types.Reboot type RecommendDatastoresBody struct { Req *types.RecommendDatastores `xml:"urn:vim25 RecommendDatastores,omitempty"` - Res *types.RecommendDatastoresResponse `xml:"urn:vim25 RecommendDatastoresResponse,omitempty"` + Res *types.RecommendDatastoresResponse `xml:"RecommendDatastoresResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10805,7 +11745,7 @@ func RecommendDatastores(ctx context.Context, r soap.RoundTripper, req *types.Re type RecommendHostsForVmBody struct { Req *types.RecommendHostsForVm `xml:"urn:vim25 RecommendHostsForVm,omitempty"` - Res *types.RecommendHostsForVmResponse `xml:"urn:vim25 RecommendHostsForVmResponse,omitempty"` + Res *types.RecommendHostsForVmResponse `xml:"RecommendHostsForVmResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10825,7 +11765,7 @@ func RecommendHostsForVm(ctx context.Context, r soap.RoundTripper, req *types.Re type RecommissionVsanNode_TaskBody struct { Req *types.RecommissionVsanNode_Task `xml:"urn:vim25 RecommissionVsanNode_Task,omitempty"` - Res *types.RecommissionVsanNode_TaskResponse `xml:"urn:vim25 RecommissionVsanNode_TaskResponse,omitempty"` + Res *types.RecommissionVsanNode_TaskResponse `xml:"RecommissionVsanNode_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10845,7 +11785,7 @@ func RecommissionVsanNode_Task(ctx context.Context, r soap.RoundTripper, req *ty type ReconcileDatastoreInventory_TaskBody struct { Req *types.ReconcileDatastoreInventory_Task `xml:"urn:vim25 ReconcileDatastoreInventory_Task,omitempty"` - Res *types.ReconcileDatastoreInventory_TaskResponse `xml:"urn:vim25 ReconcileDatastoreInventory_TaskResponse,omitempty"` + Res *types.ReconcileDatastoreInventory_TaskResponse `xml:"ReconcileDatastoreInventory_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10865,7 +11805,7 @@ func ReconcileDatastoreInventory_Task(ctx context.Context, r soap.RoundTripper, type ReconfigVM_TaskBody struct { Req *types.ReconfigVM_Task `xml:"urn:vim25 ReconfigVM_Task,omitempty"` - Res *types.ReconfigVM_TaskResponse `xml:"urn:vim25 ReconfigVM_TaskResponse,omitempty"` + Res *types.ReconfigVM_TaskResponse `xml:"ReconfigVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10885,7 +11825,7 @@ func ReconfigVM_Task(ctx context.Context, r soap.RoundTripper, req *types.Reconf type ReconfigurationSatisfiableBody struct { Req *types.ReconfigurationSatisfiable `xml:"urn:vim25 ReconfigurationSatisfiable,omitempty"` - Res *types.ReconfigurationSatisfiableResponse `xml:"urn:vim25 ReconfigurationSatisfiableResponse,omitempty"` + Res *types.ReconfigurationSatisfiableResponse `xml:"ReconfigurationSatisfiableResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10905,7 +11845,7 @@ func ReconfigurationSatisfiable(ctx context.Context, r soap.RoundTripper, req *t type ReconfigureAlarmBody struct { Req *types.ReconfigureAlarm `xml:"urn:vim25 ReconfigureAlarm,omitempty"` - Res *types.ReconfigureAlarmResponse `xml:"urn:vim25 ReconfigureAlarmResponse,omitempty"` + Res *types.ReconfigureAlarmResponse `xml:"ReconfigureAlarmResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10925,7 +11865,7 @@ func ReconfigureAlarm(ctx context.Context, r soap.RoundTripper, req *types.Recon type ReconfigureAutostartBody struct { Req *types.ReconfigureAutostart `xml:"urn:vim25 ReconfigureAutostart,omitempty"` - Res *types.ReconfigureAutostartResponse `xml:"urn:vim25 ReconfigureAutostartResponse,omitempty"` + Res *types.ReconfigureAutostartResponse `xml:"ReconfigureAutostartResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10945,7 +11885,7 @@ func ReconfigureAutostart(ctx context.Context, r soap.RoundTripper, req *types.R type ReconfigureCluster_TaskBody struct { Req *types.ReconfigureCluster_Task `xml:"urn:vim25 ReconfigureCluster_Task,omitempty"` - Res *types.ReconfigureCluster_TaskResponse `xml:"urn:vim25 ReconfigureCluster_TaskResponse,omitempty"` + Res *types.ReconfigureCluster_TaskResponse `xml:"ReconfigureCluster_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10965,7 +11905,7 @@ func ReconfigureCluster_Task(ctx context.Context, r soap.RoundTripper, req *type type ReconfigureComputeResource_TaskBody struct { Req *types.ReconfigureComputeResource_Task `xml:"urn:vim25 ReconfigureComputeResource_Task,omitempty"` - Res *types.ReconfigureComputeResource_TaskResponse `xml:"urn:vim25 ReconfigureComputeResource_TaskResponse,omitempty"` + Res *types.ReconfigureComputeResource_TaskResponse `xml:"ReconfigureComputeResource_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -10985,7 +11925,7 @@ func ReconfigureComputeResource_Task(ctx context.Context, r soap.RoundTripper, r type ReconfigureDVPort_TaskBody struct { Req *types.ReconfigureDVPort_Task `xml:"urn:vim25 ReconfigureDVPort_Task,omitempty"` - Res *types.ReconfigureDVPort_TaskResponse `xml:"urn:vim25 ReconfigureDVPort_TaskResponse,omitempty"` + Res *types.ReconfigureDVPort_TaskResponse `xml:"ReconfigureDVPort_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11005,7 +11945,7 @@ func ReconfigureDVPort_Task(ctx context.Context, r soap.RoundTripper, req *types type ReconfigureDVPortgroup_TaskBody struct { Req *types.ReconfigureDVPortgroup_Task `xml:"urn:vim25 ReconfigureDVPortgroup_Task,omitempty"` - Res *types.ReconfigureDVPortgroup_TaskResponse `xml:"urn:vim25 ReconfigureDVPortgroup_TaskResponse,omitempty"` + Res *types.ReconfigureDVPortgroup_TaskResponse `xml:"ReconfigureDVPortgroup_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11025,7 +11965,7 @@ func ReconfigureDVPortgroup_Task(ctx context.Context, r soap.RoundTripper, req * type ReconfigureDatacenter_TaskBody struct { Req *types.ReconfigureDatacenter_Task `xml:"urn:vim25 ReconfigureDatacenter_Task,omitempty"` - Res *types.ReconfigureDatacenter_TaskResponse `xml:"urn:vim25 ReconfigureDatacenter_TaskResponse,omitempty"` + Res *types.ReconfigureDatacenter_TaskResponse `xml:"ReconfigureDatacenter_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11045,7 +11985,7 @@ func ReconfigureDatacenter_Task(ctx context.Context, r soap.RoundTripper, req *t type ReconfigureDomObjectBody struct { Req *types.ReconfigureDomObject `xml:"urn:vim25 ReconfigureDomObject,omitempty"` - Res *types.ReconfigureDomObjectResponse `xml:"urn:vim25 ReconfigureDomObjectResponse,omitempty"` + Res *types.ReconfigureDomObjectResponse `xml:"ReconfigureDomObjectResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11065,7 +12005,7 @@ func ReconfigureDomObject(ctx context.Context, r soap.RoundTripper, req *types.R type ReconfigureDvs_TaskBody struct { Req *types.ReconfigureDvs_Task `xml:"urn:vim25 ReconfigureDvs_Task,omitempty"` - Res *types.ReconfigureDvs_TaskResponse `xml:"urn:vim25 ReconfigureDvs_TaskResponse,omitempty"` + Res *types.ReconfigureDvs_TaskResponse `xml:"ReconfigureDvs_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11085,7 +12025,7 @@ func ReconfigureDvs_Task(ctx context.Context, r soap.RoundTripper, req *types.Re type ReconfigureHostForDAS_TaskBody struct { Req *types.ReconfigureHostForDAS_Task `xml:"urn:vim25 ReconfigureHostForDAS_Task,omitempty"` - Res *types.ReconfigureHostForDAS_TaskResponse `xml:"urn:vim25 ReconfigureHostForDAS_TaskResponse,omitempty"` + Res *types.ReconfigureHostForDAS_TaskResponse `xml:"ReconfigureHostForDAS_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11105,7 +12045,7 @@ func ReconfigureHostForDAS_Task(ctx context.Context, r soap.RoundTripper, req *t type ReconfigureScheduledTaskBody struct { Req *types.ReconfigureScheduledTask `xml:"urn:vim25 ReconfigureScheduledTask,omitempty"` - Res *types.ReconfigureScheduledTaskResponse `xml:"urn:vim25 ReconfigureScheduledTaskResponse,omitempty"` + Res *types.ReconfigureScheduledTaskResponse `xml:"ReconfigureScheduledTaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11125,7 +12065,7 @@ func ReconfigureScheduledTask(ctx context.Context, r soap.RoundTripper, req *typ type ReconfigureServiceConsoleReservationBody struct { Req *types.ReconfigureServiceConsoleReservation `xml:"urn:vim25 ReconfigureServiceConsoleReservation,omitempty"` - Res *types.ReconfigureServiceConsoleReservationResponse `xml:"urn:vim25 ReconfigureServiceConsoleReservationResponse,omitempty"` + Res *types.ReconfigureServiceConsoleReservationResponse `xml:"ReconfigureServiceConsoleReservationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11145,7 +12085,7 @@ func ReconfigureServiceConsoleReservation(ctx context.Context, r soap.RoundTripp type ReconfigureSnmpAgentBody struct { Req *types.ReconfigureSnmpAgent `xml:"urn:vim25 ReconfigureSnmpAgent,omitempty"` - Res *types.ReconfigureSnmpAgentResponse `xml:"urn:vim25 ReconfigureSnmpAgentResponse,omitempty"` + Res *types.ReconfigureSnmpAgentResponse `xml:"ReconfigureSnmpAgentResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11165,7 +12105,7 @@ func ReconfigureSnmpAgent(ctx context.Context, r soap.RoundTripper, req *types.R type ReconfigureVirtualMachineReservationBody struct { Req *types.ReconfigureVirtualMachineReservation `xml:"urn:vim25 ReconfigureVirtualMachineReservation,omitempty"` - Res *types.ReconfigureVirtualMachineReservationResponse `xml:"urn:vim25 ReconfigureVirtualMachineReservationResponse,omitempty"` + Res *types.ReconfigureVirtualMachineReservationResponse `xml:"ReconfigureVirtualMachineReservationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11185,7 +12125,7 @@ func ReconfigureVirtualMachineReservation(ctx context.Context, r soap.RoundTripp type ReconnectHost_TaskBody struct { Req *types.ReconnectHost_Task `xml:"urn:vim25 ReconnectHost_Task,omitempty"` - Res *types.ReconnectHost_TaskResponse `xml:"urn:vim25 ReconnectHost_TaskResponse,omitempty"` + Res *types.ReconnectHost_TaskResponse `xml:"ReconnectHost_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11205,7 +12145,7 @@ func ReconnectHost_Task(ctx context.Context, r soap.RoundTripper, req *types.Rec type RectifyDvsHost_TaskBody struct { Req *types.RectifyDvsHost_Task `xml:"urn:vim25 RectifyDvsHost_Task,omitempty"` - Res *types.RectifyDvsHost_TaskResponse `xml:"urn:vim25 RectifyDvsHost_TaskResponse,omitempty"` + Res *types.RectifyDvsHost_TaskResponse `xml:"RectifyDvsHost_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11225,7 +12165,7 @@ func RectifyDvsHost_Task(ctx context.Context, r soap.RoundTripper, req *types.Re type RectifyDvsOnHost_TaskBody struct { Req *types.RectifyDvsOnHost_Task `xml:"urn:vim25 RectifyDvsOnHost_Task,omitempty"` - Res *types.RectifyDvsOnHost_TaskResponse `xml:"urn:vim25 RectifyDvsOnHost_TaskResponse,omitempty"` + Res *types.RectifyDvsOnHost_TaskResponse `xml:"RectifyDvsOnHost_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11245,7 +12185,7 @@ func RectifyDvsOnHost_Task(ctx context.Context, r soap.RoundTripper, req *types. type RefreshBody struct { Req *types.Refresh `xml:"urn:vim25 Refresh,omitempty"` - Res *types.RefreshResponse `xml:"urn:vim25 RefreshResponse,omitempty"` + Res *types.RefreshResponse `xml:"RefreshResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11265,7 +12205,7 @@ func Refresh(ctx context.Context, r soap.RoundTripper, req *types.Refresh) (*typ type RefreshDVPortStateBody struct { Req *types.RefreshDVPortState `xml:"urn:vim25 RefreshDVPortState,omitempty"` - Res *types.RefreshDVPortStateResponse `xml:"urn:vim25 RefreshDVPortStateResponse,omitempty"` + Res *types.RefreshDVPortStateResponse `xml:"RefreshDVPortStateResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11285,7 +12225,7 @@ func RefreshDVPortState(ctx context.Context, r soap.RoundTripper, req *types.Ref type RefreshDatastoreBody struct { Req *types.RefreshDatastore `xml:"urn:vim25 RefreshDatastore,omitempty"` - Res *types.RefreshDatastoreResponse `xml:"urn:vim25 RefreshDatastoreResponse,omitempty"` + Res *types.RefreshDatastoreResponse `xml:"RefreshDatastoreResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11305,7 +12245,7 @@ func RefreshDatastore(ctx context.Context, r soap.RoundTripper, req *types.Refre type RefreshDatastoreStorageInfoBody struct { Req *types.RefreshDatastoreStorageInfo `xml:"urn:vim25 RefreshDatastoreStorageInfo,omitempty"` - Res *types.RefreshDatastoreStorageInfoResponse `xml:"urn:vim25 RefreshDatastoreStorageInfoResponse,omitempty"` + Res *types.RefreshDatastoreStorageInfoResponse `xml:"RefreshDatastoreStorageInfoResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11325,7 +12265,7 @@ func RefreshDatastoreStorageInfo(ctx context.Context, r soap.RoundTripper, req * type RefreshDateTimeSystemBody struct { Req *types.RefreshDateTimeSystem `xml:"urn:vim25 RefreshDateTimeSystem,omitempty"` - Res *types.RefreshDateTimeSystemResponse `xml:"urn:vim25 RefreshDateTimeSystemResponse,omitempty"` + Res *types.RefreshDateTimeSystemResponse `xml:"RefreshDateTimeSystemResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11345,7 +12285,7 @@ func RefreshDateTimeSystem(ctx context.Context, r soap.RoundTripper, req *types. type RefreshFirewallBody struct { Req *types.RefreshFirewall `xml:"urn:vim25 RefreshFirewall,omitempty"` - Res *types.RefreshFirewallResponse `xml:"urn:vim25 RefreshFirewallResponse,omitempty"` + Res *types.RefreshFirewallResponse `xml:"RefreshFirewallResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11365,7 +12305,7 @@ func RefreshFirewall(ctx context.Context, r soap.RoundTripper, req *types.Refres type RefreshGraphicsManagerBody struct { Req *types.RefreshGraphicsManager `xml:"urn:vim25 RefreshGraphicsManager,omitempty"` - Res *types.RefreshGraphicsManagerResponse `xml:"urn:vim25 RefreshGraphicsManagerResponse,omitempty"` + Res *types.RefreshGraphicsManagerResponse `xml:"RefreshGraphicsManagerResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11385,7 +12325,7 @@ func RefreshGraphicsManager(ctx context.Context, r soap.RoundTripper, req *types type RefreshHealthStatusSystemBody struct { Req *types.RefreshHealthStatusSystem `xml:"urn:vim25 RefreshHealthStatusSystem,omitempty"` - Res *types.RefreshHealthStatusSystemResponse `xml:"urn:vim25 RefreshHealthStatusSystemResponse,omitempty"` + Res *types.RefreshHealthStatusSystemResponse `xml:"RefreshHealthStatusSystemResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11405,7 +12345,7 @@ func RefreshHealthStatusSystem(ctx context.Context, r soap.RoundTripper, req *ty type RefreshNetworkSystemBody struct { Req *types.RefreshNetworkSystem `xml:"urn:vim25 RefreshNetworkSystem,omitempty"` - Res *types.RefreshNetworkSystemResponse `xml:"urn:vim25 RefreshNetworkSystemResponse,omitempty"` + Res *types.RefreshNetworkSystemResponse `xml:"RefreshNetworkSystemResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11425,7 +12365,7 @@ func RefreshNetworkSystem(ctx context.Context, r soap.RoundTripper, req *types.R type RefreshRecommendationBody struct { Req *types.RefreshRecommendation `xml:"urn:vim25 RefreshRecommendation,omitempty"` - Res *types.RefreshRecommendationResponse `xml:"urn:vim25 RefreshRecommendationResponse,omitempty"` + Res *types.RefreshRecommendationResponse `xml:"RefreshRecommendationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11445,7 +12385,7 @@ func RefreshRecommendation(ctx context.Context, r soap.RoundTripper, req *types. type RefreshRuntimeBody struct { Req *types.RefreshRuntime `xml:"urn:vim25 RefreshRuntime,omitempty"` - Res *types.RefreshRuntimeResponse `xml:"urn:vim25 RefreshRuntimeResponse,omitempty"` + Res *types.RefreshRuntimeResponse `xml:"RefreshRuntimeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11465,7 +12405,7 @@ func RefreshRuntime(ctx context.Context, r soap.RoundTripper, req *types.Refresh type RefreshServicesBody struct { Req *types.RefreshServices `xml:"urn:vim25 RefreshServices,omitempty"` - Res *types.RefreshServicesResponse `xml:"urn:vim25 RefreshServicesResponse,omitempty"` + Res *types.RefreshServicesResponse `xml:"RefreshServicesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11485,7 +12425,7 @@ func RefreshServices(ctx context.Context, r soap.RoundTripper, req *types.Refres type RefreshStorageDrsRecommendationBody struct { Req *types.RefreshStorageDrsRecommendation `xml:"urn:vim25 RefreshStorageDrsRecommendation,omitempty"` - Res *types.RefreshStorageDrsRecommendationResponse `xml:"urn:vim25 RefreshStorageDrsRecommendationResponse,omitempty"` + Res *types.RefreshStorageDrsRecommendationResponse `xml:"RefreshStorageDrsRecommendationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11505,7 +12445,7 @@ func RefreshStorageDrsRecommendation(ctx context.Context, r soap.RoundTripper, r type RefreshStorageDrsRecommendationsForPod_TaskBody struct { Req *types.RefreshStorageDrsRecommendationsForPod_Task `xml:"urn:vim25 RefreshStorageDrsRecommendationsForPod_Task,omitempty"` - Res *types.RefreshStorageDrsRecommendationsForPod_TaskResponse `xml:"urn:vim25 RefreshStorageDrsRecommendationsForPod_TaskResponse,omitempty"` + Res *types.RefreshStorageDrsRecommendationsForPod_TaskResponse `xml:"RefreshStorageDrsRecommendationsForPod_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11525,7 +12465,7 @@ func RefreshStorageDrsRecommendationsForPod_Task(ctx context.Context, r soap.Rou type RefreshStorageInfoBody struct { Req *types.RefreshStorageInfo `xml:"urn:vim25 RefreshStorageInfo,omitempty"` - Res *types.RefreshStorageInfoResponse `xml:"urn:vim25 RefreshStorageInfoResponse,omitempty"` + Res *types.RefreshStorageInfoResponse `xml:"RefreshStorageInfoResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11545,7 +12485,7 @@ func RefreshStorageInfo(ctx context.Context, r soap.RoundTripper, req *types.Ref type RefreshStorageSystemBody struct { Req *types.RefreshStorageSystem `xml:"urn:vim25 RefreshStorageSystem,omitempty"` - Res *types.RefreshStorageSystemResponse `xml:"urn:vim25 RefreshStorageSystemResponse,omitempty"` + Res *types.RefreshStorageSystemResponse `xml:"RefreshStorageSystemResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11565,7 +12505,7 @@ func RefreshStorageSystem(ctx context.Context, r soap.RoundTripper, req *types.R type RegisterChildVM_TaskBody struct { Req *types.RegisterChildVM_Task `xml:"urn:vim25 RegisterChildVM_Task,omitempty"` - Res *types.RegisterChildVM_TaskResponse `xml:"urn:vim25 RegisterChildVM_TaskResponse,omitempty"` + Res *types.RegisterChildVM_TaskResponse `xml:"RegisterChildVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11585,7 +12525,7 @@ func RegisterChildVM_Task(ctx context.Context, r soap.RoundTripper, req *types.R type RegisterDiskBody struct { Req *types.RegisterDisk `xml:"urn:vim25 RegisterDisk,omitempty"` - Res *types.RegisterDiskResponse `xml:"urn:vim25 RegisterDiskResponse,omitempty"` + Res *types.RegisterDiskResponse `xml:"RegisterDiskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11605,7 +12545,7 @@ func RegisterDisk(ctx context.Context, r soap.RoundTripper, req *types.RegisterD type RegisterExtensionBody struct { Req *types.RegisterExtension `xml:"urn:vim25 RegisterExtension,omitempty"` - Res *types.RegisterExtensionResponse `xml:"urn:vim25 RegisterExtensionResponse,omitempty"` + Res *types.RegisterExtensionResponse `xml:"RegisterExtensionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11625,7 +12565,7 @@ func RegisterExtension(ctx context.Context, r soap.RoundTripper, req *types.Regi type RegisterHealthUpdateProviderBody struct { Req *types.RegisterHealthUpdateProvider `xml:"urn:vim25 RegisterHealthUpdateProvider,omitempty"` - Res *types.RegisterHealthUpdateProviderResponse `xml:"urn:vim25 RegisterHealthUpdateProviderResponse,omitempty"` + Res *types.RegisterHealthUpdateProviderResponse `xml:"RegisterHealthUpdateProviderResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11645,7 +12585,7 @@ func RegisterHealthUpdateProvider(ctx context.Context, r soap.RoundTripper, req type RegisterKmipServerBody struct { Req *types.RegisterKmipServer `xml:"urn:vim25 RegisterKmipServer,omitempty"` - Res *types.RegisterKmipServerResponse `xml:"urn:vim25 RegisterKmipServerResponse,omitempty"` + Res *types.RegisterKmipServerResponse `xml:"RegisterKmipServerResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11663,9 +12603,29 @@ func RegisterKmipServer(ctx context.Context, r soap.RoundTripper, req *types.Reg return resBody.Res, nil } +type RegisterKmsClusterBody struct { + Req *types.RegisterKmsCluster `xml:"urn:vim25 RegisterKmsCluster,omitempty"` + Res *types.RegisterKmsClusterResponse `xml:"RegisterKmsClusterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RegisterKmsClusterBody) Fault() *soap.Fault { return b.Fault_ } + +func RegisterKmsCluster(ctx context.Context, r soap.RoundTripper, req *types.RegisterKmsCluster) (*types.RegisterKmsClusterResponse, error) { + var reqBody, resBody RegisterKmsClusterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type RegisterVM_TaskBody struct { Req *types.RegisterVM_Task `xml:"urn:vim25 RegisterVM_Task,omitempty"` - Res *types.RegisterVM_TaskResponse `xml:"urn:vim25 RegisterVM_TaskResponse,omitempty"` + Res *types.RegisterVM_TaskResponse `xml:"RegisterVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11685,7 +12645,7 @@ func RegisterVM_Task(ctx context.Context, r soap.RoundTripper, req *types.Regist type ReleaseCredentialsInGuestBody struct { Req *types.ReleaseCredentialsInGuest `xml:"urn:vim25 ReleaseCredentialsInGuest,omitempty"` - Res *types.ReleaseCredentialsInGuestResponse `xml:"urn:vim25 ReleaseCredentialsInGuestResponse,omitempty"` + Res *types.ReleaseCredentialsInGuestResponse `xml:"ReleaseCredentialsInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11705,7 +12665,7 @@ func ReleaseCredentialsInGuest(ctx context.Context, r soap.RoundTripper, req *ty type ReleaseIpAllocationBody struct { Req *types.ReleaseIpAllocation `xml:"urn:vim25 ReleaseIpAllocation,omitempty"` - Res *types.ReleaseIpAllocationResponse `xml:"urn:vim25 ReleaseIpAllocationResponse,omitempty"` + Res *types.ReleaseIpAllocationResponse `xml:"ReleaseIpAllocationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11725,7 +12685,7 @@ func ReleaseIpAllocation(ctx context.Context, r soap.RoundTripper, req *types.Re type ReleaseManagedSnapshotBody struct { Req *types.ReleaseManagedSnapshot `xml:"urn:vim25 ReleaseManagedSnapshot,omitempty"` - Res *types.ReleaseManagedSnapshotResponse `xml:"urn:vim25 ReleaseManagedSnapshotResponse,omitempty"` + Res *types.ReleaseManagedSnapshotResponse `xml:"ReleaseManagedSnapshotResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11745,7 +12705,7 @@ func ReleaseManagedSnapshot(ctx context.Context, r soap.RoundTripper, req *types type ReloadBody struct { Req *types.Reload `xml:"urn:vim25 Reload,omitempty"` - Res *types.ReloadResponse `xml:"urn:vim25 ReloadResponse,omitempty"` + Res *types.ReloadResponse `xml:"ReloadResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11765,7 +12725,7 @@ func Reload(ctx context.Context, r soap.RoundTripper, req *types.Reload) (*types type RelocateVM_TaskBody struct { Req *types.RelocateVM_Task `xml:"urn:vim25 RelocateVM_Task,omitempty"` - Res *types.RelocateVM_TaskResponse `xml:"urn:vim25 RelocateVM_TaskResponse,omitempty"` + Res *types.RelocateVM_TaskResponse `xml:"RelocateVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11785,7 +12745,7 @@ func RelocateVM_Task(ctx context.Context, r soap.RoundTripper, req *types.Reloca type RelocateVStorageObject_TaskBody struct { Req *types.RelocateVStorageObject_Task `xml:"urn:vim25 RelocateVStorageObject_Task,omitempty"` - Res *types.RelocateVStorageObject_TaskResponse `xml:"urn:vim25 RelocateVStorageObject_TaskResponse,omitempty"` + Res *types.RelocateVStorageObject_TaskResponse `xml:"RelocateVStorageObject_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11805,7 +12765,7 @@ func RelocateVStorageObject_Task(ctx context.Context, r soap.RoundTripper, req * type RemoveAlarmBody struct { Req *types.RemoveAlarm `xml:"urn:vim25 RemoveAlarm,omitempty"` - Res *types.RemoveAlarmResponse `xml:"urn:vim25 RemoveAlarmResponse,omitempty"` + Res *types.RemoveAlarmResponse `xml:"RemoveAlarmResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11825,7 +12785,7 @@ func RemoveAlarm(ctx context.Context, r soap.RoundTripper, req *types.RemoveAlar type RemoveAllSnapshots_TaskBody struct { Req *types.RemoveAllSnapshots_Task `xml:"urn:vim25 RemoveAllSnapshots_Task,omitempty"` - Res *types.RemoveAllSnapshots_TaskResponse `xml:"urn:vim25 RemoveAllSnapshots_TaskResponse,omitempty"` + Res *types.RemoveAllSnapshots_TaskResponse `xml:"RemoveAllSnapshots_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11845,7 +12805,7 @@ func RemoveAllSnapshots_Task(ctx context.Context, r soap.RoundTripper, req *type type RemoveAssignedLicenseBody struct { Req *types.RemoveAssignedLicense `xml:"urn:vim25 RemoveAssignedLicense,omitempty"` - Res *types.RemoveAssignedLicenseResponse `xml:"urn:vim25 RemoveAssignedLicenseResponse,omitempty"` + Res *types.RemoveAssignedLicenseResponse `xml:"RemoveAssignedLicenseResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11865,7 +12825,7 @@ func RemoveAssignedLicense(ctx context.Context, r soap.RoundTripper, req *types. type RemoveAuthorizationRoleBody struct { Req *types.RemoveAuthorizationRole `xml:"urn:vim25 RemoveAuthorizationRole,omitempty"` - Res *types.RemoveAuthorizationRoleResponse `xml:"urn:vim25 RemoveAuthorizationRoleResponse,omitempty"` + Res *types.RemoveAuthorizationRoleResponse `xml:"RemoveAuthorizationRoleResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11885,7 +12845,7 @@ func RemoveAuthorizationRole(ctx context.Context, r soap.RoundTripper, req *type type RemoveCustomFieldDefBody struct { Req *types.RemoveCustomFieldDef `xml:"urn:vim25 RemoveCustomFieldDef,omitempty"` - Res *types.RemoveCustomFieldDefResponse `xml:"urn:vim25 RemoveCustomFieldDefResponse,omitempty"` + Res *types.RemoveCustomFieldDefResponse `xml:"RemoveCustomFieldDefResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11905,7 +12865,7 @@ func RemoveCustomFieldDef(ctx context.Context, r soap.RoundTripper, req *types.R type RemoveDatastoreBody struct { Req *types.RemoveDatastore `xml:"urn:vim25 RemoveDatastore,omitempty"` - Res *types.RemoveDatastoreResponse `xml:"urn:vim25 RemoveDatastoreResponse,omitempty"` + Res *types.RemoveDatastoreResponse `xml:"RemoveDatastoreResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11925,7 +12885,7 @@ func RemoveDatastore(ctx context.Context, r soap.RoundTripper, req *types.Remove type RemoveDatastoreEx_TaskBody struct { Req *types.RemoveDatastoreEx_Task `xml:"urn:vim25 RemoveDatastoreEx_Task,omitempty"` - Res *types.RemoveDatastoreEx_TaskResponse `xml:"urn:vim25 RemoveDatastoreEx_TaskResponse,omitempty"` + Res *types.RemoveDatastoreEx_TaskResponse `xml:"RemoveDatastoreEx_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11945,7 +12905,7 @@ func RemoveDatastoreEx_Task(ctx context.Context, r soap.RoundTripper, req *types type RemoveDiskMapping_TaskBody struct { Req *types.RemoveDiskMapping_Task `xml:"urn:vim25 RemoveDiskMapping_Task,omitempty"` - Res *types.RemoveDiskMapping_TaskResponse `xml:"urn:vim25 RemoveDiskMapping_TaskResponse,omitempty"` + Res *types.RemoveDiskMapping_TaskResponse `xml:"RemoveDiskMapping_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11965,7 +12925,7 @@ func RemoveDiskMapping_Task(ctx context.Context, r soap.RoundTripper, req *types type RemoveDisk_TaskBody struct { Req *types.RemoveDisk_Task `xml:"urn:vim25 RemoveDisk_Task,omitempty"` - Res *types.RemoveDisk_TaskResponse `xml:"urn:vim25 RemoveDisk_TaskResponse,omitempty"` + Res *types.RemoveDisk_TaskResponse `xml:"RemoveDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -11985,7 +12945,7 @@ func RemoveDisk_Task(ctx context.Context, r soap.RoundTripper, req *types.Remove type RemoveEntityPermissionBody struct { Req *types.RemoveEntityPermission `xml:"urn:vim25 RemoveEntityPermission,omitempty"` - Res *types.RemoveEntityPermissionResponse `xml:"urn:vim25 RemoveEntityPermissionResponse,omitempty"` + Res *types.RemoveEntityPermissionResponse `xml:"RemoveEntityPermissionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12005,7 +12965,7 @@ func RemoveEntityPermission(ctx context.Context, r soap.RoundTripper, req *types type RemoveFilterBody struct { Req *types.RemoveFilter `xml:"urn:vim25 RemoveFilter,omitempty"` - Res *types.RemoveFilterResponse `xml:"urn:vim25 RemoveFilterResponse,omitempty"` + Res *types.RemoveFilterResponse `xml:"RemoveFilterResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12025,7 +12985,7 @@ func RemoveFilter(ctx context.Context, r soap.RoundTripper, req *types.RemoveFil type RemoveFilterEntitiesBody struct { Req *types.RemoveFilterEntities `xml:"urn:vim25 RemoveFilterEntities,omitempty"` - Res *types.RemoveFilterEntitiesResponse `xml:"urn:vim25 RemoveFilterEntitiesResponse,omitempty"` + Res *types.RemoveFilterEntitiesResponse `xml:"RemoveFilterEntitiesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12045,7 +13005,7 @@ func RemoveFilterEntities(ctx context.Context, r soap.RoundTripper, req *types.R type RemoveGroupBody struct { Req *types.RemoveGroup `xml:"urn:vim25 RemoveGroup,omitempty"` - Res *types.RemoveGroupResponse `xml:"urn:vim25 RemoveGroupResponse,omitempty"` + Res *types.RemoveGroupResponse `xml:"RemoveGroupResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12065,7 +13025,7 @@ func RemoveGroup(ctx context.Context, r soap.RoundTripper, req *types.RemoveGrou type RemoveGuestAliasBody struct { Req *types.RemoveGuestAlias `xml:"urn:vim25 RemoveGuestAlias,omitempty"` - Res *types.RemoveGuestAliasResponse `xml:"urn:vim25 RemoveGuestAliasResponse,omitempty"` + Res *types.RemoveGuestAliasResponse `xml:"RemoveGuestAliasResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12085,7 +13045,7 @@ func RemoveGuestAlias(ctx context.Context, r soap.RoundTripper, req *types.Remov type RemoveGuestAliasByCertBody struct { Req *types.RemoveGuestAliasByCert `xml:"urn:vim25 RemoveGuestAliasByCert,omitempty"` - Res *types.RemoveGuestAliasByCertResponse `xml:"urn:vim25 RemoveGuestAliasByCertResponse,omitempty"` + Res *types.RemoveGuestAliasByCertResponse `xml:"RemoveGuestAliasByCertResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12105,7 +13065,7 @@ func RemoveGuestAliasByCert(ctx context.Context, r soap.RoundTripper, req *types type RemoveInternetScsiSendTargetsBody struct { Req *types.RemoveInternetScsiSendTargets `xml:"urn:vim25 RemoveInternetScsiSendTargets,omitempty"` - Res *types.RemoveInternetScsiSendTargetsResponse `xml:"urn:vim25 RemoveInternetScsiSendTargetsResponse,omitempty"` + Res *types.RemoveInternetScsiSendTargetsResponse `xml:"RemoveInternetScsiSendTargetsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12125,7 +13085,7 @@ func RemoveInternetScsiSendTargets(ctx context.Context, r soap.RoundTripper, req type RemoveInternetScsiStaticTargetsBody struct { Req *types.RemoveInternetScsiStaticTargets `xml:"urn:vim25 RemoveInternetScsiStaticTargets,omitempty"` - Res *types.RemoveInternetScsiStaticTargetsResponse `xml:"urn:vim25 RemoveInternetScsiStaticTargetsResponse,omitempty"` + Res *types.RemoveInternetScsiStaticTargetsResponse `xml:"RemoveInternetScsiStaticTargetsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12145,7 +13105,7 @@ func RemoveInternetScsiStaticTargets(ctx context.Context, r soap.RoundTripper, r type RemoveKeyBody struct { Req *types.RemoveKey `xml:"urn:vim25 RemoveKey,omitempty"` - Res *types.RemoveKeyResponse `xml:"urn:vim25 RemoveKeyResponse,omitempty"` + Res *types.RemoveKeyResponse `xml:"RemoveKeyResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12165,7 +13125,7 @@ func RemoveKey(ctx context.Context, r soap.RoundTripper, req *types.RemoveKey) ( type RemoveKeysBody struct { Req *types.RemoveKeys `xml:"urn:vim25 RemoveKeys,omitempty"` - Res *types.RemoveKeysResponse `xml:"urn:vim25 RemoveKeysResponse,omitempty"` + Res *types.RemoveKeysResponse `xml:"RemoveKeysResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12185,7 +13145,7 @@ func RemoveKeys(ctx context.Context, r soap.RoundTripper, req *types.RemoveKeys) type RemoveKmipServerBody struct { Req *types.RemoveKmipServer `xml:"urn:vim25 RemoveKmipServer,omitempty"` - Res *types.RemoveKmipServerResponse `xml:"urn:vim25 RemoveKmipServerResponse,omitempty"` + Res *types.RemoveKmipServerResponse `xml:"RemoveKmipServerResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12205,7 +13165,7 @@ func RemoveKmipServer(ctx context.Context, r soap.RoundTripper, req *types.Remov type RemoveLicenseBody struct { Req *types.RemoveLicense `xml:"urn:vim25 RemoveLicense,omitempty"` - Res *types.RemoveLicenseResponse `xml:"urn:vim25 RemoveLicenseResponse,omitempty"` + Res *types.RemoveLicenseResponse `xml:"RemoveLicenseResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12225,7 +13185,7 @@ func RemoveLicense(ctx context.Context, r soap.RoundTripper, req *types.RemoveLi type RemoveLicenseLabelBody struct { Req *types.RemoveLicenseLabel `xml:"urn:vim25 RemoveLicenseLabel,omitempty"` - Res *types.RemoveLicenseLabelResponse `xml:"urn:vim25 RemoveLicenseLabelResponse,omitempty"` + Res *types.RemoveLicenseLabelResponse `xml:"RemoveLicenseLabelResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12245,7 +13205,7 @@ func RemoveLicenseLabel(ctx context.Context, r soap.RoundTripper, req *types.Rem type RemoveMonitoredEntitiesBody struct { Req *types.RemoveMonitoredEntities `xml:"urn:vim25 RemoveMonitoredEntities,omitempty"` - Res *types.RemoveMonitoredEntitiesResponse `xml:"urn:vim25 RemoveMonitoredEntitiesResponse,omitempty"` + Res *types.RemoveMonitoredEntitiesResponse `xml:"RemoveMonitoredEntitiesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12265,7 +13225,7 @@ func RemoveMonitoredEntities(ctx context.Context, r soap.RoundTripper, req *type type RemoveNetworkResourcePoolBody struct { Req *types.RemoveNetworkResourcePool `xml:"urn:vim25 RemoveNetworkResourcePool,omitempty"` - Res *types.RemoveNetworkResourcePoolResponse `xml:"urn:vim25 RemoveNetworkResourcePoolResponse,omitempty"` + Res *types.RemoveNetworkResourcePoolResponse `xml:"RemoveNetworkResourcePoolResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12283,9 +13243,29 @@ func RemoveNetworkResourcePool(ctx context.Context, r soap.RoundTripper, req *ty return resBody.Res, nil } +type RemoveNvmeOverRdmaAdapterBody struct { + Req *types.RemoveNvmeOverRdmaAdapter `xml:"urn:vim25 RemoveNvmeOverRdmaAdapter,omitempty"` + Res *types.RemoveNvmeOverRdmaAdapterResponse `xml:"RemoveNvmeOverRdmaAdapterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveNvmeOverRdmaAdapterBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveNvmeOverRdmaAdapter(ctx context.Context, r soap.RoundTripper, req *types.RemoveNvmeOverRdmaAdapter) (*types.RemoveNvmeOverRdmaAdapterResponse, error) { + var reqBody, resBody RemoveNvmeOverRdmaAdapterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type RemovePerfIntervalBody struct { Req *types.RemovePerfInterval `xml:"urn:vim25 RemovePerfInterval,omitempty"` - Res *types.RemovePerfIntervalResponse `xml:"urn:vim25 RemovePerfIntervalResponse,omitempty"` + Res *types.RemovePerfIntervalResponse `xml:"RemovePerfIntervalResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12305,7 +13285,7 @@ func RemovePerfInterval(ctx context.Context, r soap.RoundTripper, req *types.Rem type RemovePortGroupBody struct { Req *types.RemovePortGroup `xml:"urn:vim25 RemovePortGroup,omitempty"` - Res *types.RemovePortGroupResponse `xml:"urn:vim25 RemovePortGroupResponse,omitempty"` + Res *types.RemovePortGroupResponse `xml:"RemovePortGroupResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12325,7 +13305,7 @@ func RemovePortGroup(ctx context.Context, r soap.RoundTripper, req *types.Remove type RemoveScheduledTaskBody struct { Req *types.RemoveScheduledTask `xml:"urn:vim25 RemoveScheduledTask,omitempty"` - Res *types.RemoveScheduledTaskResponse `xml:"urn:vim25 RemoveScheduledTaskResponse,omitempty"` + Res *types.RemoveScheduledTaskResponse `xml:"RemoveScheduledTaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12345,7 +13325,7 @@ func RemoveScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.Re type RemoveServiceConsoleVirtualNicBody struct { Req *types.RemoveServiceConsoleVirtualNic `xml:"urn:vim25 RemoveServiceConsoleVirtualNic,omitempty"` - Res *types.RemoveServiceConsoleVirtualNicResponse `xml:"urn:vim25 RemoveServiceConsoleVirtualNicResponse,omitempty"` + Res *types.RemoveServiceConsoleVirtualNicResponse `xml:"RemoveServiceConsoleVirtualNicResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12365,7 +13345,7 @@ func RemoveServiceConsoleVirtualNic(ctx context.Context, r soap.RoundTripper, re type RemoveSmartCardTrustAnchorBody struct { Req *types.RemoveSmartCardTrustAnchor `xml:"urn:vim25 RemoveSmartCardTrustAnchor,omitempty"` - Res *types.RemoveSmartCardTrustAnchorResponse `xml:"urn:vim25 RemoveSmartCardTrustAnchorResponse,omitempty"` + Res *types.RemoveSmartCardTrustAnchorResponse `xml:"RemoveSmartCardTrustAnchorResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12385,7 +13365,7 @@ func RemoveSmartCardTrustAnchor(ctx context.Context, r soap.RoundTripper, req *t type RemoveSmartCardTrustAnchorByFingerprintBody struct { Req *types.RemoveSmartCardTrustAnchorByFingerprint `xml:"urn:vim25 RemoveSmartCardTrustAnchorByFingerprint,omitempty"` - Res *types.RemoveSmartCardTrustAnchorByFingerprintResponse `xml:"urn:vim25 RemoveSmartCardTrustAnchorByFingerprintResponse,omitempty"` + Res *types.RemoveSmartCardTrustAnchorByFingerprintResponse `xml:"RemoveSmartCardTrustAnchorByFingerprintResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12405,7 +13385,7 @@ func RemoveSmartCardTrustAnchorByFingerprint(ctx context.Context, r soap.RoundTr type RemoveSnapshot_TaskBody struct { Req *types.RemoveSnapshot_Task `xml:"urn:vim25 RemoveSnapshot_Task,omitempty"` - Res *types.RemoveSnapshot_TaskResponse `xml:"urn:vim25 RemoveSnapshot_TaskResponse,omitempty"` + Res *types.RemoveSnapshot_TaskResponse `xml:"RemoveSnapshot_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12423,9 +13403,29 @@ func RemoveSnapshot_Task(ctx context.Context, r soap.RoundTripper, req *types.Re return resBody.Res, nil } +type RemoveSoftwareAdapterBody struct { + Req *types.RemoveSoftwareAdapter `xml:"urn:vim25 RemoveSoftwareAdapter,omitempty"` + Res *types.RemoveSoftwareAdapterResponse `xml:"RemoveSoftwareAdapterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RemoveSoftwareAdapterBody) Fault() *soap.Fault { return b.Fault_ } + +func RemoveSoftwareAdapter(ctx context.Context, r soap.RoundTripper, req *types.RemoveSoftwareAdapter) (*types.RemoveSoftwareAdapterResponse, error) { + var reqBody, resBody RemoveSoftwareAdapterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type RemoveUserBody struct { Req *types.RemoveUser `xml:"urn:vim25 RemoveUser,omitempty"` - Res *types.RemoveUserResponse `xml:"urn:vim25 RemoveUserResponse,omitempty"` + Res *types.RemoveUserResponse `xml:"RemoveUserResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12445,7 +13445,7 @@ func RemoveUser(ctx context.Context, r soap.RoundTripper, req *types.RemoveUser) type RemoveVirtualNicBody struct { Req *types.RemoveVirtualNic `xml:"urn:vim25 RemoveVirtualNic,omitempty"` - Res *types.RemoveVirtualNicResponse `xml:"urn:vim25 RemoveVirtualNicResponse,omitempty"` + Res *types.RemoveVirtualNicResponse `xml:"RemoveVirtualNicResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12465,7 +13465,7 @@ func RemoveVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.Remov type RemoveVirtualSwitchBody struct { Req *types.RemoveVirtualSwitch `xml:"urn:vim25 RemoveVirtualSwitch,omitempty"` - Res *types.RemoveVirtualSwitchResponse `xml:"urn:vim25 RemoveVirtualSwitchResponse,omitempty"` + Res *types.RemoveVirtualSwitchResponse `xml:"RemoveVirtualSwitchResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12485,7 +13485,7 @@ func RemoveVirtualSwitch(ctx context.Context, r soap.RoundTripper, req *types.Re type RenameCustomFieldDefBody struct { Req *types.RenameCustomFieldDef `xml:"urn:vim25 RenameCustomFieldDef,omitempty"` - Res *types.RenameCustomFieldDefResponse `xml:"urn:vim25 RenameCustomFieldDefResponse,omitempty"` + Res *types.RenameCustomFieldDefResponse `xml:"RenameCustomFieldDefResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12505,7 +13505,7 @@ func RenameCustomFieldDef(ctx context.Context, r soap.RoundTripper, req *types.R type RenameCustomizationSpecBody struct { Req *types.RenameCustomizationSpec `xml:"urn:vim25 RenameCustomizationSpec,omitempty"` - Res *types.RenameCustomizationSpecResponse `xml:"urn:vim25 RenameCustomizationSpecResponse,omitempty"` + Res *types.RenameCustomizationSpecResponse `xml:"RenameCustomizationSpecResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12525,7 +13525,7 @@ func RenameCustomizationSpec(ctx context.Context, r soap.RoundTripper, req *type type RenameDatastoreBody struct { Req *types.RenameDatastore `xml:"urn:vim25 RenameDatastore,omitempty"` - Res *types.RenameDatastoreResponse `xml:"urn:vim25 RenameDatastoreResponse,omitempty"` + Res *types.RenameDatastoreResponse `xml:"RenameDatastoreResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12545,7 +13545,7 @@ func RenameDatastore(ctx context.Context, r soap.RoundTripper, req *types.Rename type RenameSnapshotBody struct { Req *types.RenameSnapshot `xml:"urn:vim25 RenameSnapshot,omitempty"` - Res *types.RenameSnapshotResponse `xml:"urn:vim25 RenameSnapshotResponse,omitempty"` + Res *types.RenameSnapshotResponse `xml:"RenameSnapshotResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12565,7 +13565,7 @@ func RenameSnapshot(ctx context.Context, r soap.RoundTripper, req *types.RenameS type RenameVStorageObjectBody struct { Req *types.RenameVStorageObject `xml:"urn:vim25 RenameVStorageObject,omitempty"` - Res *types.RenameVStorageObjectResponse `xml:"urn:vim25 RenameVStorageObjectResponse,omitempty"` + Res *types.RenameVStorageObjectResponse `xml:"RenameVStorageObjectResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12585,7 +13585,7 @@ func RenameVStorageObject(ctx context.Context, r soap.RoundTripper, req *types.R type Rename_TaskBody struct { Req *types.Rename_Task `xml:"urn:vim25 Rename_Task,omitempty"` - Res *types.Rename_TaskResponse `xml:"urn:vim25 Rename_TaskResponse,omitempty"` + Res *types.Rename_TaskResponse `xml:"Rename_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12605,7 +13605,7 @@ func Rename_Task(ctx context.Context, r soap.RoundTripper, req *types.Rename_Tas type ReplaceCACertificatesAndCRLsBody struct { Req *types.ReplaceCACertificatesAndCRLs `xml:"urn:vim25 ReplaceCACertificatesAndCRLs,omitempty"` - Res *types.ReplaceCACertificatesAndCRLsResponse `xml:"urn:vim25 ReplaceCACertificatesAndCRLsResponse,omitempty"` + Res *types.ReplaceCACertificatesAndCRLsResponse `xml:"ReplaceCACertificatesAndCRLsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12625,7 +13625,7 @@ func ReplaceCACertificatesAndCRLs(ctx context.Context, r soap.RoundTripper, req type ReplaceSmartCardTrustAnchorsBody struct { Req *types.ReplaceSmartCardTrustAnchors `xml:"urn:vim25 ReplaceSmartCardTrustAnchors,omitempty"` - Res *types.ReplaceSmartCardTrustAnchorsResponse `xml:"urn:vim25 ReplaceSmartCardTrustAnchorsResponse,omitempty"` + Res *types.ReplaceSmartCardTrustAnchorsResponse `xml:"ReplaceSmartCardTrustAnchorsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12645,7 +13645,7 @@ func ReplaceSmartCardTrustAnchors(ctx context.Context, r soap.RoundTripper, req type RescanAllHbaBody struct { Req *types.RescanAllHba `xml:"urn:vim25 RescanAllHba,omitempty"` - Res *types.RescanAllHbaResponse `xml:"urn:vim25 RescanAllHbaResponse,omitempty"` + Res *types.RescanAllHbaResponse `xml:"RescanAllHbaResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12665,7 +13665,7 @@ func RescanAllHba(ctx context.Context, r soap.RoundTripper, req *types.RescanAll type RescanHbaBody struct { Req *types.RescanHba `xml:"urn:vim25 RescanHba,omitempty"` - Res *types.RescanHbaResponse `xml:"urn:vim25 RescanHbaResponse,omitempty"` + Res *types.RescanHbaResponse `xml:"RescanHbaResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12685,7 +13685,7 @@ func RescanHba(ctx context.Context, r soap.RoundTripper, req *types.RescanHba) ( type RescanVffsBody struct { Req *types.RescanVffs `xml:"urn:vim25 RescanVffs,omitempty"` - Res *types.RescanVffsResponse `xml:"urn:vim25 RescanVffsResponse,omitempty"` + Res *types.RescanVffsResponse `xml:"RescanVffsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12705,7 +13705,7 @@ func RescanVffs(ctx context.Context, r soap.RoundTripper, req *types.RescanVffs) type RescanVmfsBody struct { Req *types.RescanVmfs `xml:"urn:vim25 RescanVmfs,omitempty"` - Res *types.RescanVmfsResponse `xml:"urn:vim25 RescanVmfsResponse,omitempty"` + Res *types.RescanVmfsResponse `xml:"RescanVmfsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12725,7 +13725,7 @@ func RescanVmfs(ctx context.Context, r soap.RoundTripper, req *types.RescanVmfs) type ResetCollectorBody struct { Req *types.ResetCollector `xml:"urn:vim25 ResetCollector,omitempty"` - Res *types.ResetCollectorResponse `xml:"urn:vim25 ResetCollectorResponse,omitempty"` + Res *types.ResetCollectorResponse `xml:"ResetCollectorResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12745,7 +13745,7 @@ func ResetCollector(ctx context.Context, r soap.RoundTripper, req *types.ResetCo type ResetCounterLevelMappingBody struct { Req *types.ResetCounterLevelMapping `xml:"urn:vim25 ResetCounterLevelMapping,omitempty"` - Res *types.ResetCounterLevelMappingResponse `xml:"urn:vim25 ResetCounterLevelMappingResponse,omitempty"` + Res *types.ResetCounterLevelMappingResponse `xml:"ResetCounterLevelMappingResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12765,7 +13765,7 @@ func ResetCounterLevelMapping(ctx context.Context, r soap.RoundTripper, req *typ type ResetEntityPermissionsBody struct { Req *types.ResetEntityPermissions `xml:"urn:vim25 ResetEntityPermissions,omitempty"` - Res *types.ResetEntityPermissionsResponse `xml:"urn:vim25 ResetEntityPermissionsResponse,omitempty"` + Res *types.ResetEntityPermissionsResponse `xml:"ResetEntityPermissionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12785,7 +13785,7 @@ func ResetEntityPermissions(ctx context.Context, r soap.RoundTripper, req *types type ResetFirmwareToFactoryDefaultsBody struct { Req *types.ResetFirmwareToFactoryDefaults `xml:"urn:vim25 ResetFirmwareToFactoryDefaults,omitempty"` - Res *types.ResetFirmwareToFactoryDefaultsResponse `xml:"urn:vim25 ResetFirmwareToFactoryDefaultsResponse,omitempty"` + Res *types.ResetFirmwareToFactoryDefaultsResponse `xml:"ResetFirmwareToFactoryDefaultsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12805,7 +13805,7 @@ func ResetFirmwareToFactoryDefaults(ctx context.Context, r soap.RoundTripper, re type ResetGuestInformationBody struct { Req *types.ResetGuestInformation `xml:"urn:vim25 ResetGuestInformation,omitempty"` - Res *types.ResetGuestInformationResponse `xml:"urn:vim25 ResetGuestInformationResponse,omitempty"` + Res *types.ResetGuestInformationResponse `xml:"ResetGuestInformationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12825,7 +13825,7 @@ func ResetGuestInformation(ctx context.Context, r soap.RoundTripper, req *types. type ResetListViewBody struct { Req *types.ResetListView `xml:"urn:vim25 ResetListView,omitempty"` - Res *types.ResetListViewResponse `xml:"urn:vim25 ResetListViewResponse,omitempty"` + Res *types.ResetListViewResponse `xml:"ResetListViewResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12845,7 +13845,7 @@ func ResetListView(ctx context.Context, r soap.RoundTripper, req *types.ResetLis type ResetListViewFromViewBody struct { Req *types.ResetListViewFromView `xml:"urn:vim25 ResetListViewFromView,omitempty"` - Res *types.ResetListViewFromViewResponse `xml:"urn:vim25 ResetListViewFromViewResponse,omitempty"` + Res *types.ResetListViewFromViewResponse `xml:"ResetListViewFromViewResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12865,7 +13865,7 @@ func ResetListViewFromView(ctx context.Context, r soap.RoundTripper, req *types. type ResetSystemHealthInfoBody struct { Req *types.ResetSystemHealthInfo `xml:"urn:vim25 ResetSystemHealthInfo,omitempty"` - Res *types.ResetSystemHealthInfoResponse `xml:"urn:vim25 ResetSystemHealthInfoResponse,omitempty"` + Res *types.ResetSystemHealthInfoResponse `xml:"ResetSystemHealthInfoResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12885,7 +13885,7 @@ func ResetSystemHealthInfo(ctx context.Context, r soap.RoundTripper, req *types. type ResetVM_TaskBody struct { Req *types.ResetVM_Task `xml:"urn:vim25 ResetVM_Task,omitempty"` - Res *types.ResetVM_TaskResponse `xml:"urn:vim25 ResetVM_TaskResponse,omitempty"` + Res *types.ResetVM_TaskResponse `xml:"ResetVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12905,7 +13905,7 @@ func ResetVM_Task(ctx context.Context, r soap.RoundTripper, req *types.ResetVM_T type ResignatureUnresolvedVmfsVolume_TaskBody struct { Req *types.ResignatureUnresolvedVmfsVolume_Task `xml:"urn:vim25 ResignatureUnresolvedVmfsVolume_Task,omitempty"` - Res *types.ResignatureUnresolvedVmfsVolume_TaskResponse `xml:"urn:vim25 ResignatureUnresolvedVmfsVolume_TaskResponse,omitempty"` + Res *types.ResignatureUnresolvedVmfsVolume_TaskResponse `xml:"ResignatureUnresolvedVmfsVolume_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12925,7 +13925,7 @@ func ResignatureUnresolvedVmfsVolume_Task(ctx context.Context, r soap.RoundTripp type ResolveInstallationErrorsOnCluster_TaskBody struct { Req *types.ResolveInstallationErrorsOnCluster_Task `xml:"urn:vim25 ResolveInstallationErrorsOnCluster_Task,omitempty"` - Res *types.ResolveInstallationErrorsOnCluster_TaskResponse `xml:"urn:vim25 ResolveInstallationErrorsOnCluster_TaskResponse,omitempty"` + Res *types.ResolveInstallationErrorsOnCluster_TaskResponse `xml:"ResolveInstallationErrorsOnCluster_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12945,7 +13945,7 @@ func ResolveInstallationErrorsOnCluster_Task(ctx context.Context, r soap.RoundTr type ResolveInstallationErrorsOnHost_TaskBody struct { Req *types.ResolveInstallationErrorsOnHost_Task `xml:"urn:vim25 ResolveInstallationErrorsOnHost_Task,omitempty"` - Res *types.ResolveInstallationErrorsOnHost_TaskResponse `xml:"urn:vim25 ResolveInstallationErrorsOnHost_TaskResponse,omitempty"` + Res *types.ResolveInstallationErrorsOnHost_TaskResponse `xml:"ResolveInstallationErrorsOnHost_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12965,7 +13965,7 @@ func ResolveInstallationErrorsOnHost_Task(ctx context.Context, r soap.RoundTripp type ResolveMultipleUnresolvedVmfsVolumesBody struct { Req *types.ResolveMultipleUnresolvedVmfsVolumes `xml:"urn:vim25 ResolveMultipleUnresolvedVmfsVolumes,omitempty"` - Res *types.ResolveMultipleUnresolvedVmfsVolumesResponse `xml:"urn:vim25 ResolveMultipleUnresolvedVmfsVolumesResponse,omitempty"` + Res *types.ResolveMultipleUnresolvedVmfsVolumesResponse `xml:"ResolveMultipleUnresolvedVmfsVolumesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -12985,7 +13985,7 @@ func ResolveMultipleUnresolvedVmfsVolumes(ctx context.Context, r soap.RoundTripp type ResolveMultipleUnresolvedVmfsVolumesEx_TaskBody struct { Req *types.ResolveMultipleUnresolvedVmfsVolumesEx_Task `xml:"urn:vim25 ResolveMultipleUnresolvedVmfsVolumesEx_Task,omitempty"` - Res *types.ResolveMultipleUnresolvedVmfsVolumesEx_TaskResponse `xml:"urn:vim25 ResolveMultipleUnresolvedVmfsVolumesEx_TaskResponse,omitempty"` + Res *types.ResolveMultipleUnresolvedVmfsVolumesEx_TaskResponse `xml:"ResolveMultipleUnresolvedVmfsVolumesEx_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13005,7 +14005,7 @@ func ResolveMultipleUnresolvedVmfsVolumesEx_Task(ctx context.Context, r soap.Rou type RestartServiceBody struct { Req *types.RestartService `xml:"urn:vim25 RestartService,omitempty"` - Res *types.RestartServiceResponse `xml:"urn:vim25 RestartServiceResponse,omitempty"` + Res *types.RestartServiceResponse `xml:"RestartServiceResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13025,7 +14025,7 @@ func RestartService(ctx context.Context, r soap.RoundTripper, req *types.Restart type RestartServiceConsoleVirtualNicBody struct { Req *types.RestartServiceConsoleVirtualNic `xml:"urn:vim25 RestartServiceConsoleVirtualNic,omitempty"` - Res *types.RestartServiceConsoleVirtualNicResponse `xml:"urn:vim25 RestartServiceConsoleVirtualNicResponse,omitempty"` + Res *types.RestartServiceConsoleVirtualNicResponse `xml:"RestartServiceConsoleVirtualNicResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13045,7 +14045,7 @@ func RestartServiceConsoleVirtualNic(ctx context.Context, r soap.RoundTripper, r type RestoreFirmwareConfigurationBody struct { Req *types.RestoreFirmwareConfiguration `xml:"urn:vim25 RestoreFirmwareConfiguration,omitempty"` - Res *types.RestoreFirmwareConfigurationResponse `xml:"urn:vim25 RestoreFirmwareConfigurationResponse,omitempty"` + Res *types.RestoreFirmwareConfigurationResponse `xml:"RestoreFirmwareConfigurationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13065,7 +14065,7 @@ func RestoreFirmwareConfiguration(ctx context.Context, r soap.RoundTripper, req type RetrieveAllPermissionsBody struct { Req *types.RetrieveAllPermissions `xml:"urn:vim25 RetrieveAllPermissions,omitempty"` - Res *types.RetrieveAllPermissionsResponse `xml:"urn:vim25 RetrieveAllPermissionsResponse,omitempty"` + Res *types.RetrieveAllPermissionsResponse `xml:"RetrieveAllPermissionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13085,7 +14085,7 @@ func RetrieveAllPermissions(ctx context.Context, r soap.RoundTripper, req *types type RetrieveAnswerFileBody struct { Req *types.RetrieveAnswerFile `xml:"urn:vim25 RetrieveAnswerFile,omitempty"` - Res *types.RetrieveAnswerFileResponse `xml:"urn:vim25 RetrieveAnswerFileResponse,omitempty"` + Res *types.RetrieveAnswerFileResponse `xml:"RetrieveAnswerFileResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13105,7 +14105,7 @@ func RetrieveAnswerFile(ctx context.Context, r soap.RoundTripper, req *types.Ret type RetrieveAnswerFileForProfileBody struct { Req *types.RetrieveAnswerFileForProfile `xml:"urn:vim25 RetrieveAnswerFileForProfile,omitempty"` - Res *types.RetrieveAnswerFileForProfileResponse `xml:"urn:vim25 RetrieveAnswerFileForProfileResponse,omitempty"` + Res *types.RetrieveAnswerFileForProfileResponse `xml:"RetrieveAnswerFileForProfileResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13125,7 +14125,7 @@ func RetrieveAnswerFileForProfile(ctx context.Context, r soap.RoundTripper, req type RetrieveArgumentDescriptionBody struct { Req *types.RetrieveArgumentDescription `xml:"urn:vim25 RetrieveArgumentDescription,omitempty"` - Res *types.RetrieveArgumentDescriptionResponse `xml:"urn:vim25 RetrieveArgumentDescriptionResponse,omitempty"` + Res *types.RetrieveArgumentDescriptionResponse `xml:"RetrieveArgumentDescriptionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13145,7 +14145,7 @@ func RetrieveArgumentDescription(ctx context.Context, r soap.RoundTripper, req * type RetrieveClientCertBody struct { Req *types.RetrieveClientCert `xml:"urn:vim25 RetrieveClientCert,omitempty"` - Res *types.RetrieveClientCertResponse `xml:"urn:vim25 RetrieveClientCertResponse,omitempty"` + Res *types.RetrieveClientCertResponse `xml:"RetrieveClientCertResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13165,7 +14165,7 @@ func RetrieveClientCert(ctx context.Context, r soap.RoundTripper, req *types.Ret type RetrieveClientCsrBody struct { Req *types.RetrieveClientCsr `xml:"urn:vim25 RetrieveClientCsr,omitempty"` - Res *types.RetrieveClientCsrResponse `xml:"urn:vim25 RetrieveClientCsrResponse,omitempty"` + Res *types.RetrieveClientCsrResponse `xml:"RetrieveClientCsrResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13185,7 +14185,7 @@ func RetrieveClientCsr(ctx context.Context, r soap.RoundTripper, req *types.Retr type RetrieveDasAdvancedRuntimeInfoBody struct { Req *types.RetrieveDasAdvancedRuntimeInfo `xml:"urn:vim25 RetrieveDasAdvancedRuntimeInfo,omitempty"` - Res *types.RetrieveDasAdvancedRuntimeInfoResponse `xml:"urn:vim25 RetrieveDasAdvancedRuntimeInfoResponse,omitempty"` + Res *types.RetrieveDasAdvancedRuntimeInfoResponse `xml:"RetrieveDasAdvancedRuntimeInfoResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13205,7 +14205,7 @@ func RetrieveDasAdvancedRuntimeInfo(ctx context.Context, r soap.RoundTripper, re type RetrieveDescriptionBody struct { Req *types.RetrieveDescription `xml:"urn:vim25 RetrieveDescription,omitempty"` - Res *types.RetrieveDescriptionResponse `xml:"urn:vim25 RetrieveDescriptionResponse,omitempty"` + Res *types.RetrieveDescriptionResponse `xml:"RetrieveDescriptionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13225,7 +14225,7 @@ func RetrieveDescription(ctx context.Context, r soap.RoundTripper, req *types.Re type RetrieveDiskPartitionInfoBody struct { Req *types.RetrieveDiskPartitionInfo `xml:"urn:vim25 RetrieveDiskPartitionInfo,omitempty"` - Res *types.RetrieveDiskPartitionInfoResponse `xml:"urn:vim25 RetrieveDiskPartitionInfoResponse,omitempty"` + Res *types.RetrieveDiskPartitionInfoResponse `xml:"RetrieveDiskPartitionInfoResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13243,9 +14243,29 @@ func RetrieveDiskPartitionInfo(ctx context.Context, r soap.RoundTripper, req *ty return resBody.Res, nil } +type RetrieveDynamicPassthroughInfoBody struct { + Req *types.RetrieveDynamicPassthroughInfo `xml:"urn:vim25 RetrieveDynamicPassthroughInfo,omitempty"` + Res *types.RetrieveDynamicPassthroughInfoResponse `xml:"RetrieveDynamicPassthroughInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveDynamicPassthroughInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveDynamicPassthroughInfo(ctx context.Context, r soap.RoundTripper, req *types.RetrieveDynamicPassthroughInfo) (*types.RetrieveDynamicPassthroughInfoResponse, error) { + var reqBody, resBody RetrieveDynamicPassthroughInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type RetrieveEntityPermissionsBody struct { Req *types.RetrieveEntityPermissions `xml:"urn:vim25 RetrieveEntityPermissions,omitempty"` - Res *types.RetrieveEntityPermissionsResponse `xml:"urn:vim25 RetrieveEntityPermissionsResponse,omitempty"` + Res *types.RetrieveEntityPermissionsResponse `xml:"RetrieveEntityPermissionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13265,7 +14285,7 @@ func RetrieveEntityPermissions(ctx context.Context, r soap.RoundTripper, req *ty type RetrieveEntityScheduledTaskBody struct { Req *types.RetrieveEntityScheduledTask `xml:"urn:vim25 RetrieveEntityScheduledTask,omitempty"` - Res *types.RetrieveEntityScheduledTaskResponse `xml:"urn:vim25 RetrieveEntityScheduledTaskResponse,omitempty"` + Res *types.RetrieveEntityScheduledTaskResponse `xml:"RetrieveEntityScheduledTaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13283,9 +14303,29 @@ func RetrieveEntityScheduledTask(ctx context.Context, r soap.RoundTripper, req * return resBody.Res, nil } +type RetrieveFreeEpcMemoryBody struct { + Req *types.RetrieveFreeEpcMemory `xml:"urn:vim25 RetrieveFreeEpcMemory,omitempty"` + Res *types.RetrieveFreeEpcMemoryResponse `xml:"RetrieveFreeEpcMemoryResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveFreeEpcMemoryBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveFreeEpcMemory(ctx context.Context, r soap.RoundTripper, req *types.RetrieveFreeEpcMemory) (*types.RetrieveFreeEpcMemoryResponse, error) { + var reqBody, resBody RetrieveFreeEpcMemoryBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type RetrieveHardwareUptimeBody struct { Req *types.RetrieveHardwareUptime `xml:"urn:vim25 RetrieveHardwareUptime,omitempty"` - Res *types.RetrieveHardwareUptimeResponse `xml:"urn:vim25 RetrieveHardwareUptimeResponse,omitempty"` + Res *types.RetrieveHardwareUptimeResponse `xml:"RetrieveHardwareUptimeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13305,7 +14345,7 @@ func RetrieveHardwareUptime(ctx context.Context, r soap.RoundTripper, req *types type RetrieveHostAccessControlEntriesBody struct { Req *types.RetrieveHostAccessControlEntries `xml:"urn:vim25 RetrieveHostAccessControlEntries,omitempty"` - Res *types.RetrieveHostAccessControlEntriesResponse `xml:"urn:vim25 RetrieveHostAccessControlEntriesResponse,omitempty"` + Res *types.RetrieveHostAccessControlEntriesResponse `xml:"RetrieveHostAccessControlEntriesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13325,7 +14365,7 @@ func RetrieveHostAccessControlEntries(ctx context.Context, r soap.RoundTripper, type RetrieveHostCustomizationsBody struct { Req *types.RetrieveHostCustomizations `xml:"urn:vim25 RetrieveHostCustomizations,omitempty"` - Res *types.RetrieveHostCustomizationsResponse `xml:"urn:vim25 RetrieveHostCustomizationsResponse,omitempty"` + Res *types.RetrieveHostCustomizationsResponse `xml:"RetrieveHostCustomizationsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13345,7 +14385,7 @@ func RetrieveHostCustomizations(ctx context.Context, r soap.RoundTripper, req *t type RetrieveHostCustomizationsForProfileBody struct { Req *types.RetrieveHostCustomizationsForProfile `xml:"urn:vim25 RetrieveHostCustomizationsForProfile,omitempty"` - Res *types.RetrieveHostCustomizationsForProfileResponse `xml:"urn:vim25 RetrieveHostCustomizationsForProfileResponse,omitempty"` + Res *types.RetrieveHostCustomizationsForProfileResponse `xml:"RetrieveHostCustomizationsForProfileResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13365,7 +14405,7 @@ func RetrieveHostCustomizationsForProfile(ctx context.Context, r soap.RoundTripp type RetrieveHostSpecificationBody struct { Req *types.RetrieveHostSpecification `xml:"urn:vim25 RetrieveHostSpecification,omitempty"` - Res *types.RetrieveHostSpecificationResponse `xml:"urn:vim25 RetrieveHostSpecificationResponse,omitempty"` + Res *types.RetrieveHostSpecificationResponse `xml:"RetrieveHostSpecificationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13385,7 +14425,7 @@ func RetrieveHostSpecification(ctx context.Context, r soap.RoundTripper, req *ty type RetrieveKmipServerCertBody struct { Req *types.RetrieveKmipServerCert `xml:"urn:vim25 RetrieveKmipServerCert,omitempty"` - Res *types.RetrieveKmipServerCertResponse `xml:"urn:vim25 RetrieveKmipServerCertResponse,omitempty"` + Res *types.RetrieveKmipServerCertResponse `xml:"RetrieveKmipServerCertResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13405,7 +14445,7 @@ func RetrieveKmipServerCert(ctx context.Context, r soap.RoundTripper, req *types type RetrieveKmipServersStatus_TaskBody struct { Req *types.RetrieveKmipServersStatus_Task `xml:"urn:vim25 RetrieveKmipServersStatus_Task,omitempty"` - Res *types.RetrieveKmipServersStatus_TaskResponse `xml:"urn:vim25 RetrieveKmipServersStatus_TaskResponse,omitempty"` + Res *types.RetrieveKmipServersStatus_TaskResponse `xml:"RetrieveKmipServersStatus_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13425,7 +14465,7 @@ func RetrieveKmipServersStatus_Task(ctx context.Context, r soap.RoundTripper, re type RetrieveObjectScheduledTaskBody struct { Req *types.RetrieveObjectScheduledTask `xml:"urn:vim25 RetrieveObjectScheduledTask,omitempty"` - Res *types.RetrieveObjectScheduledTaskResponse `xml:"urn:vim25 RetrieveObjectScheduledTaskResponse,omitempty"` + Res *types.RetrieveObjectScheduledTaskResponse `xml:"RetrieveObjectScheduledTaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13445,7 +14485,7 @@ func RetrieveObjectScheduledTask(ctx context.Context, r soap.RoundTripper, req * type RetrieveProductComponentsBody struct { Req *types.RetrieveProductComponents `xml:"urn:vim25 RetrieveProductComponents,omitempty"` - Res *types.RetrieveProductComponentsResponse `xml:"urn:vim25 RetrieveProductComponentsResponse,omitempty"` + Res *types.RetrieveProductComponentsResponse `xml:"RetrieveProductComponentsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13465,7 +14505,7 @@ func RetrieveProductComponents(ctx context.Context, r soap.RoundTripper, req *ty type RetrievePropertiesBody struct { Req *types.RetrieveProperties `xml:"urn:vim25 RetrieveProperties,omitempty"` - Res *types.RetrievePropertiesResponse `xml:"urn:vim25 RetrievePropertiesResponse,omitempty"` + Res *types.RetrievePropertiesResponse `xml:"RetrievePropertiesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13485,7 +14525,7 @@ func RetrieveProperties(ctx context.Context, r soap.RoundTripper, req *types.Ret type RetrievePropertiesExBody struct { Req *types.RetrievePropertiesEx `xml:"urn:vim25 RetrievePropertiesEx,omitempty"` - Res *types.RetrievePropertiesExResponse `xml:"urn:vim25 RetrievePropertiesExResponse,omitempty"` + Res *types.RetrievePropertiesExResponse `xml:"RetrievePropertiesExResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13505,7 +14545,7 @@ func RetrievePropertiesEx(ctx context.Context, r soap.RoundTripper, req *types.R type RetrieveRolePermissionsBody struct { Req *types.RetrieveRolePermissions `xml:"urn:vim25 RetrieveRolePermissions,omitempty"` - Res *types.RetrieveRolePermissionsResponse `xml:"urn:vim25 RetrieveRolePermissionsResponse,omitempty"` + Res *types.RetrieveRolePermissionsResponse `xml:"RetrieveRolePermissionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13525,7 +14565,7 @@ func RetrieveRolePermissions(ctx context.Context, r soap.RoundTripper, req *type type RetrieveSelfSignedClientCertBody struct { Req *types.RetrieveSelfSignedClientCert `xml:"urn:vim25 RetrieveSelfSignedClientCert,omitempty"` - Res *types.RetrieveSelfSignedClientCertResponse `xml:"urn:vim25 RetrieveSelfSignedClientCertResponse,omitempty"` + Res *types.RetrieveSelfSignedClientCertResponse `xml:"RetrieveSelfSignedClientCertResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13545,7 +14585,7 @@ func RetrieveSelfSignedClientCert(ctx context.Context, r soap.RoundTripper, req type RetrieveServiceContentBody struct { Req *types.RetrieveServiceContent `xml:"urn:vim25 RetrieveServiceContent,omitempty"` - Res *types.RetrieveServiceContentResponse `xml:"urn:vim25 RetrieveServiceContentResponse,omitempty"` + Res *types.RetrieveServiceContentResponse `xml:"RetrieveServiceContentResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13563,9 +14603,49 @@ func RetrieveServiceContent(ctx context.Context, r soap.RoundTripper, req *types return resBody.Res, nil } +type RetrieveServiceProviderEntitiesBody struct { + Req *types.RetrieveServiceProviderEntities `xml:"urn:vim25 RetrieveServiceProviderEntities,omitempty"` + Res *types.RetrieveServiceProviderEntitiesResponse `xml:"RetrieveServiceProviderEntitiesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveServiceProviderEntitiesBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveServiceProviderEntities(ctx context.Context, r soap.RoundTripper, req *types.RetrieveServiceProviderEntities) (*types.RetrieveServiceProviderEntitiesResponse, error) { + var reqBody, resBody RetrieveServiceProviderEntitiesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveSnapshotDetailsBody struct { + Req *types.RetrieveSnapshotDetails `xml:"urn:vim25 RetrieveSnapshotDetails,omitempty"` + Res *types.RetrieveSnapshotDetailsResponse `xml:"RetrieveSnapshotDetailsResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveSnapshotDetailsBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveSnapshotDetails(ctx context.Context, r soap.RoundTripper, req *types.RetrieveSnapshotDetails) (*types.RetrieveSnapshotDetailsResponse, error) { + var reqBody, resBody RetrieveSnapshotDetailsBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type RetrieveSnapshotInfoBody struct { Req *types.RetrieveSnapshotInfo `xml:"urn:vim25 RetrieveSnapshotInfo,omitempty"` - Res *types.RetrieveSnapshotInfoResponse `xml:"urn:vim25 RetrieveSnapshotInfoResponse,omitempty"` + Res *types.RetrieveSnapshotInfoResponse `xml:"RetrieveSnapshotInfoResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13585,7 +14665,7 @@ func RetrieveSnapshotInfo(ctx context.Context, r soap.RoundTripper, req *types.R type RetrieveUserGroupsBody struct { Req *types.RetrieveUserGroups `xml:"urn:vim25 RetrieveUserGroups,omitempty"` - Res *types.RetrieveUserGroupsResponse `xml:"urn:vim25 RetrieveUserGroupsResponse,omitempty"` + Res *types.RetrieveUserGroupsResponse `xml:"RetrieveUserGroupsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13605,7 +14685,7 @@ func RetrieveUserGroups(ctx context.Context, r soap.RoundTripper, req *types.Ret type RetrieveVStorageInfrastructureObjectPolicyBody struct { Req *types.RetrieveVStorageInfrastructureObjectPolicy `xml:"urn:vim25 RetrieveVStorageInfrastructureObjectPolicy,omitempty"` - Res *types.RetrieveVStorageInfrastructureObjectPolicyResponse `xml:"urn:vim25 RetrieveVStorageInfrastructureObjectPolicyResponse,omitempty"` + Res *types.RetrieveVStorageInfrastructureObjectPolicyResponse `xml:"RetrieveVStorageInfrastructureObjectPolicyResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13625,7 +14705,7 @@ func RetrieveVStorageInfrastructureObjectPolicy(ctx context.Context, r soap.Roun type RetrieveVStorageObjectBody struct { Req *types.RetrieveVStorageObject `xml:"urn:vim25 RetrieveVStorageObject,omitempty"` - Res *types.RetrieveVStorageObjectResponse `xml:"urn:vim25 RetrieveVStorageObjectResponse,omitempty"` + Res *types.RetrieveVStorageObjectResponse `xml:"RetrieveVStorageObjectResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13645,7 +14725,7 @@ func RetrieveVStorageObject(ctx context.Context, r soap.RoundTripper, req *types type RetrieveVStorageObjectAssociationsBody struct { Req *types.RetrieveVStorageObjectAssociations `xml:"urn:vim25 RetrieveVStorageObjectAssociations,omitempty"` - Res *types.RetrieveVStorageObjectAssociationsResponse `xml:"urn:vim25 RetrieveVStorageObjectAssociationsResponse,omitempty"` + Res *types.RetrieveVStorageObjectAssociationsResponse `xml:"RetrieveVStorageObjectAssociationsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13665,7 +14745,7 @@ func RetrieveVStorageObjectAssociations(ctx context.Context, r soap.RoundTripper type RetrieveVStorageObjectStateBody struct { Req *types.RetrieveVStorageObjectState `xml:"urn:vim25 RetrieveVStorageObjectState,omitempty"` - Res *types.RetrieveVStorageObjectStateResponse `xml:"urn:vim25 RetrieveVStorageObjectStateResponse,omitempty"` + Res *types.RetrieveVStorageObjectStateResponse `xml:"RetrieveVStorageObjectStateResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13683,9 +14763,69 @@ func RetrieveVStorageObjectState(ctx context.Context, r soap.RoundTripper, req * return resBody.Res, nil } +type RetrieveVendorDeviceGroupInfoBody struct { + Req *types.RetrieveVendorDeviceGroupInfo `xml:"urn:vim25 RetrieveVendorDeviceGroupInfo,omitempty"` + Res *types.RetrieveVendorDeviceGroupInfoResponse `xml:"RetrieveVendorDeviceGroupInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveVendorDeviceGroupInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveVendorDeviceGroupInfo(ctx context.Context, r soap.RoundTripper, req *types.RetrieveVendorDeviceGroupInfo) (*types.RetrieveVendorDeviceGroupInfoResponse, error) { + var reqBody, resBody RetrieveVendorDeviceGroupInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveVgpuDeviceInfoBody struct { + Req *types.RetrieveVgpuDeviceInfo `xml:"urn:vim25 RetrieveVgpuDeviceInfo,omitempty"` + Res *types.RetrieveVgpuDeviceInfoResponse `xml:"RetrieveVgpuDeviceInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveVgpuDeviceInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveVgpuDeviceInfo(ctx context.Context, r soap.RoundTripper, req *types.RetrieveVgpuDeviceInfo) (*types.RetrieveVgpuDeviceInfoResponse, error) { + var reqBody, resBody RetrieveVgpuDeviceInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type RetrieveVgpuProfileInfoBody struct { + Req *types.RetrieveVgpuProfileInfo `xml:"urn:vim25 RetrieveVgpuProfileInfo,omitempty"` + Res *types.RetrieveVgpuProfileInfoResponse `xml:"RetrieveVgpuProfileInfoResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *RetrieveVgpuProfileInfoBody) Fault() *soap.Fault { return b.Fault_ } + +func RetrieveVgpuProfileInfo(ctx context.Context, r soap.RoundTripper, req *types.RetrieveVgpuProfileInfo) (*types.RetrieveVgpuProfileInfoResponse, error) { + var reqBody, resBody RetrieveVgpuProfileInfoBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type RevertToCurrentSnapshot_TaskBody struct { Req *types.RevertToCurrentSnapshot_Task `xml:"urn:vim25 RevertToCurrentSnapshot_Task,omitempty"` - Res *types.RevertToCurrentSnapshot_TaskResponse `xml:"urn:vim25 RevertToCurrentSnapshot_TaskResponse,omitempty"` + Res *types.RevertToCurrentSnapshot_TaskResponse `xml:"RevertToCurrentSnapshot_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13705,7 +14845,7 @@ func RevertToCurrentSnapshot_Task(ctx context.Context, r soap.RoundTripper, req type RevertToSnapshot_TaskBody struct { Req *types.RevertToSnapshot_Task `xml:"urn:vim25 RevertToSnapshot_Task,omitempty"` - Res *types.RevertToSnapshot_TaskResponse `xml:"urn:vim25 RevertToSnapshot_TaskResponse,omitempty"` + Res *types.RevertToSnapshot_TaskResponse `xml:"RevertToSnapshot_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13725,7 +14865,7 @@ func RevertToSnapshot_Task(ctx context.Context, r soap.RoundTripper, req *types. type RevertVStorageObject_TaskBody struct { Req *types.RevertVStorageObject_Task `xml:"urn:vim25 RevertVStorageObject_Task,omitempty"` - Res *types.RevertVStorageObject_TaskResponse `xml:"urn:vim25 RevertVStorageObject_TaskResponse,omitempty"` + Res *types.RevertVStorageObject_TaskResponse `xml:"RevertVStorageObject_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13745,7 +14885,7 @@ func RevertVStorageObject_Task(ctx context.Context, r soap.RoundTripper, req *ty type RewindCollectorBody struct { Req *types.RewindCollector `xml:"urn:vim25 RewindCollector,omitempty"` - Res *types.RewindCollectorResponse `xml:"urn:vim25 RewindCollectorResponse,omitempty"` + Res *types.RewindCollectorResponse `xml:"RewindCollectorResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13765,7 +14905,7 @@ func RewindCollector(ctx context.Context, r soap.RoundTripper, req *types.Rewind type RunScheduledTaskBody struct { Req *types.RunScheduledTask `xml:"urn:vim25 RunScheduledTask,omitempty"` - Res *types.RunScheduledTaskResponse `xml:"urn:vim25 RunScheduledTaskResponse,omitempty"` + Res *types.RunScheduledTaskResponse `xml:"RunScheduledTaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13785,7 +14925,7 @@ func RunScheduledTask(ctx context.Context, r soap.RoundTripper, req *types.RunSc type RunVsanPhysicalDiskDiagnosticsBody struct { Req *types.RunVsanPhysicalDiskDiagnostics `xml:"urn:vim25 RunVsanPhysicalDiskDiagnostics,omitempty"` - Res *types.RunVsanPhysicalDiskDiagnosticsResponse `xml:"urn:vim25 RunVsanPhysicalDiskDiagnosticsResponse,omitempty"` + Res *types.RunVsanPhysicalDiskDiagnosticsResponse `xml:"RunVsanPhysicalDiskDiagnosticsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13805,7 +14945,7 @@ func RunVsanPhysicalDiskDiagnostics(ctx context.Context, r soap.RoundTripper, re type ScanHostPatchV2_TaskBody struct { Req *types.ScanHostPatchV2_Task `xml:"urn:vim25 ScanHostPatchV2_Task,omitempty"` - Res *types.ScanHostPatchV2_TaskResponse `xml:"urn:vim25 ScanHostPatchV2_TaskResponse,omitempty"` + Res *types.ScanHostPatchV2_TaskResponse `xml:"ScanHostPatchV2_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13825,7 +14965,7 @@ func ScanHostPatchV2_Task(ctx context.Context, r soap.RoundTripper, req *types.S type ScanHostPatch_TaskBody struct { Req *types.ScanHostPatch_Task `xml:"urn:vim25 ScanHostPatch_Task,omitempty"` - Res *types.ScanHostPatch_TaskResponse `xml:"urn:vim25 ScanHostPatch_TaskResponse,omitempty"` + Res *types.ScanHostPatch_TaskResponse `xml:"ScanHostPatch_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13845,7 +14985,7 @@ func ScanHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.Sca type ScheduleReconcileDatastoreInventoryBody struct { Req *types.ScheduleReconcileDatastoreInventory `xml:"urn:vim25 ScheduleReconcileDatastoreInventory,omitempty"` - Res *types.ScheduleReconcileDatastoreInventoryResponse `xml:"urn:vim25 ScheduleReconcileDatastoreInventoryResponse,omitempty"` + Res *types.ScheduleReconcileDatastoreInventoryResponse `xml:"ScheduleReconcileDatastoreInventoryResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13865,7 +15005,7 @@ func ScheduleReconcileDatastoreInventory(ctx context.Context, r soap.RoundTrippe type SearchDatastoreSubFolders_TaskBody struct { Req *types.SearchDatastoreSubFolders_Task `xml:"urn:vim25 SearchDatastoreSubFolders_Task,omitempty"` - Res *types.SearchDatastoreSubFolders_TaskResponse `xml:"urn:vim25 SearchDatastoreSubFolders_TaskResponse,omitempty"` + Res *types.SearchDatastoreSubFolders_TaskResponse `xml:"SearchDatastoreSubFolders_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13885,7 +15025,7 @@ func SearchDatastoreSubFolders_Task(ctx context.Context, r soap.RoundTripper, re type SearchDatastore_TaskBody struct { Req *types.SearchDatastore_Task `xml:"urn:vim25 SearchDatastore_Task,omitempty"` - Res *types.SearchDatastore_TaskResponse `xml:"urn:vim25 SearchDatastore_TaskResponse,omitempty"` + Res *types.SearchDatastore_TaskResponse `xml:"SearchDatastore_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13905,7 +15045,7 @@ func SearchDatastore_Task(ctx context.Context, r soap.RoundTripper, req *types.S type SelectActivePartitionBody struct { Req *types.SelectActivePartition `xml:"urn:vim25 SelectActivePartition,omitempty"` - Res *types.SelectActivePartitionResponse `xml:"urn:vim25 SelectActivePartitionResponse,omitempty"` + Res *types.SelectActivePartitionResponse `xml:"SelectActivePartitionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13925,7 +15065,7 @@ func SelectActivePartition(ctx context.Context, r soap.RoundTripper, req *types. type SelectVnicBody struct { Req *types.SelectVnic `xml:"urn:vim25 SelectVnic,omitempty"` - Res *types.SelectVnicResponse `xml:"urn:vim25 SelectVnicResponse,omitempty"` + Res *types.SelectVnicResponse `xml:"SelectVnicResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13945,7 +15085,7 @@ func SelectVnic(ctx context.Context, r soap.RoundTripper, req *types.SelectVnic) type SelectVnicForNicTypeBody struct { Req *types.SelectVnicForNicType `xml:"urn:vim25 SelectVnicForNicType,omitempty"` - Res *types.SelectVnicForNicTypeResponse `xml:"urn:vim25 SelectVnicForNicTypeResponse,omitempty"` + Res *types.SelectVnicForNicTypeResponse `xml:"SelectVnicForNicTypeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13965,7 +15105,7 @@ func SelectVnicForNicType(ctx context.Context, r soap.RoundTripper, req *types.S type SendNMIBody struct { Req *types.SendNMI `xml:"urn:vim25 SendNMI,omitempty"` - Res *types.SendNMIResponse `xml:"urn:vim25 SendNMIResponse,omitempty"` + Res *types.SendNMIResponse `xml:"SendNMIResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -13985,7 +15125,7 @@ func SendNMI(ctx context.Context, r soap.RoundTripper, req *types.SendNMI) (*typ type SendTestNotificationBody struct { Req *types.SendTestNotification `xml:"urn:vim25 SendTestNotification,omitempty"` - Res *types.SendTestNotificationResponse `xml:"urn:vim25 SendTestNotificationResponse,omitempty"` + Res *types.SendTestNotificationResponse `xml:"SendTestNotificationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14005,7 +15145,7 @@ func SendTestNotification(ctx context.Context, r soap.RoundTripper, req *types.S type SessionIsActiveBody struct { Req *types.SessionIsActive `xml:"urn:vim25 SessionIsActive,omitempty"` - Res *types.SessionIsActiveResponse `xml:"urn:vim25 SessionIsActiveResponse,omitempty"` + Res *types.SessionIsActiveResponse `xml:"SessionIsActiveResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14025,7 +15165,7 @@ func SessionIsActive(ctx context.Context, r soap.RoundTripper, req *types.Sessio type SetCollectorPageSizeBody struct { Req *types.SetCollectorPageSize `xml:"urn:vim25 SetCollectorPageSize,omitempty"` - Res *types.SetCollectorPageSizeResponse `xml:"urn:vim25 SetCollectorPageSizeResponse,omitempty"` + Res *types.SetCollectorPageSizeResponse `xml:"SetCollectorPageSizeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14043,9 +15183,49 @@ func SetCollectorPageSize(ctx context.Context, r soap.RoundTripper, req *types.S return resBody.Res, nil } +type SetCryptoModeBody struct { + Req *types.SetCryptoMode `xml:"urn:vim25 SetCryptoMode,omitempty"` + Res *types.SetCryptoModeResponse `xml:"SetCryptoModeResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetCryptoModeBody) Fault() *soap.Fault { return b.Fault_ } + +func SetCryptoMode(ctx context.Context, r soap.RoundTripper, req *types.SetCryptoMode) (*types.SetCryptoModeResponse, error) { + var reqBody, resBody SetCryptoModeBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + +type SetDefaultKmsClusterBody struct { + Req *types.SetDefaultKmsCluster `xml:"urn:vim25 SetDefaultKmsCluster,omitempty"` + Res *types.SetDefaultKmsClusterResponse `xml:"SetDefaultKmsClusterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetDefaultKmsClusterBody) Fault() *soap.Fault { return b.Fault_ } + +func SetDefaultKmsCluster(ctx context.Context, r soap.RoundTripper, req *types.SetDefaultKmsCluster) (*types.SetDefaultKmsClusterResponse, error) { + var reqBody, resBody SetDefaultKmsClusterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type SetDisplayTopologyBody struct { Req *types.SetDisplayTopology `xml:"urn:vim25 SetDisplayTopology,omitempty"` - Res *types.SetDisplayTopologyResponse `xml:"urn:vim25 SetDisplayTopologyResponse,omitempty"` + Res *types.SetDisplayTopologyResponse `xml:"SetDisplayTopologyResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14065,7 +15245,7 @@ func SetDisplayTopology(ctx context.Context, r soap.RoundTripper, req *types.Set type SetEntityPermissionsBody struct { Req *types.SetEntityPermissions `xml:"urn:vim25 SetEntityPermissions,omitempty"` - Res *types.SetEntityPermissionsResponse `xml:"urn:vim25 SetEntityPermissionsResponse,omitempty"` + Res *types.SetEntityPermissionsResponse `xml:"SetEntityPermissionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14085,7 +15265,7 @@ func SetEntityPermissions(ctx context.Context, r soap.RoundTripper, req *types.S type SetExtensionCertificateBody struct { Req *types.SetExtensionCertificate `xml:"urn:vim25 SetExtensionCertificate,omitempty"` - Res *types.SetExtensionCertificateResponse `xml:"urn:vim25 SetExtensionCertificateResponse,omitempty"` + Res *types.SetExtensionCertificateResponse `xml:"SetExtensionCertificateResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14105,7 +15285,7 @@ func SetExtensionCertificate(ctx context.Context, r soap.RoundTripper, req *type type SetFieldBody struct { Req *types.SetField `xml:"urn:vim25 SetField,omitempty"` - Res *types.SetFieldResponse `xml:"urn:vim25 SetFieldResponse,omitempty"` + Res *types.SetFieldResponse `xml:"SetFieldResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14125,7 +15305,7 @@ func SetField(ctx context.Context, r soap.RoundTripper, req *types.SetField) (*t type SetLicenseEditionBody struct { Req *types.SetLicenseEdition `xml:"urn:vim25 SetLicenseEdition,omitempty"` - Res *types.SetLicenseEditionResponse `xml:"urn:vim25 SetLicenseEditionResponse,omitempty"` + Res *types.SetLicenseEditionResponse `xml:"SetLicenseEditionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14145,7 +15325,7 @@ func SetLicenseEdition(ctx context.Context, r soap.RoundTripper, req *types.SetL type SetLocaleBody struct { Req *types.SetLocale `xml:"urn:vim25 SetLocale,omitempty"` - Res *types.SetLocaleResponse `xml:"urn:vim25 SetLocaleResponse,omitempty"` + Res *types.SetLocaleResponse `xml:"SetLocaleResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14163,9 +15343,29 @@ func SetLocale(ctx context.Context, r soap.RoundTripper, req *types.SetLocale) ( return resBody.Res, nil } +type SetMaxQueueDepthBody struct { + Req *types.SetMaxQueueDepth `xml:"urn:vim25 SetMaxQueueDepth,omitempty"` + Res *types.SetMaxQueueDepthResponse `xml:"SetMaxQueueDepthResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetMaxQueueDepthBody) Fault() *soap.Fault { return b.Fault_ } + +func SetMaxQueueDepth(ctx context.Context, r soap.RoundTripper, req *types.SetMaxQueueDepth) (*types.SetMaxQueueDepthResponse, error) { + var reqBody, resBody SetMaxQueueDepthBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type SetMultipathLunPolicyBody struct { Req *types.SetMultipathLunPolicy `xml:"urn:vim25 SetMultipathLunPolicy,omitempty"` - Res *types.SetMultipathLunPolicyResponse `xml:"urn:vim25 SetMultipathLunPolicyResponse,omitempty"` + Res *types.SetMultipathLunPolicyResponse `xml:"SetMultipathLunPolicyResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14185,7 +15385,7 @@ func SetMultipathLunPolicy(ctx context.Context, r soap.RoundTripper, req *types. type SetNFSUserBody struct { Req *types.SetNFSUser `xml:"urn:vim25 SetNFSUser,omitempty"` - Res *types.SetNFSUserResponse `xml:"urn:vim25 SetNFSUserResponse,omitempty"` + Res *types.SetNFSUserResponse `xml:"SetNFSUserResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14205,7 +15405,7 @@ func SetNFSUser(ctx context.Context, r soap.RoundTripper, req *types.SetNFSUser) type SetPublicKeyBody struct { Req *types.SetPublicKey `xml:"urn:vim25 SetPublicKey,omitempty"` - Res *types.SetPublicKeyResponse `xml:"urn:vim25 SetPublicKeyResponse,omitempty"` + Res *types.SetPublicKeyResponse `xml:"SetPublicKeyResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14225,7 +15425,7 @@ func SetPublicKey(ctx context.Context, r soap.RoundTripper, req *types.SetPublic type SetRegistryValueInGuestBody struct { Req *types.SetRegistryValueInGuest `xml:"urn:vim25 SetRegistryValueInGuest,omitempty"` - Res *types.SetRegistryValueInGuestResponse `xml:"urn:vim25 SetRegistryValueInGuestResponse,omitempty"` + Res *types.SetRegistryValueInGuestResponse `xml:"SetRegistryValueInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14245,7 +15445,7 @@ func SetRegistryValueInGuest(ctx context.Context, r soap.RoundTripper, req *type type SetScreenResolutionBody struct { Req *types.SetScreenResolution `xml:"urn:vim25 SetScreenResolution,omitempty"` - Res *types.SetScreenResolutionResponse `xml:"urn:vim25 SetScreenResolutionResponse,omitempty"` + Res *types.SetScreenResolutionResponse `xml:"SetScreenResolutionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14265,7 +15465,7 @@ func SetScreenResolution(ctx context.Context, r soap.RoundTripper, req *types.Se type SetTaskDescriptionBody struct { Req *types.SetTaskDescription `xml:"urn:vim25 SetTaskDescription,omitempty"` - Res *types.SetTaskDescriptionResponse `xml:"urn:vim25 SetTaskDescriptionResponse,omitempty"` + Res *types.SetTaskDescriptionResponse `xml:"SetTaskDescriptionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14285,7 +15485,7 @@ func SetTaskDescription(ctx context.Context, r soap.RoundTripper, req *types.Set type SetTaskStateBody struct { Req *types.SetTaskState `xml:"urn:vim25 SetTaskState,omitempty"` - Res *types.SetTaskStateResponse `xml:"urn:vim25 SetTaskStateResponse,omitempty"` + Res *types.SetTaskStateResponse `xml:"SetTaskStateResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14305,7 +15505,7 @@ func SetTaskState(ctx context.Context, r soap.RoundTripper, req *types.SetTaskSt type SetVStorageObjectControlFlagsBody struct { Req *types.SetVStorageObjectControlFlags `xml:"urn:vim25 SetVStorageObjectControlFlags,omitempty"` - Res *types.SetVStorageObjectControlFlagsResponse `xml:"urn:vim25 SetVStorageObjectControlFlagsResponse,omitempty"` + Res *types.SetVStorageObjectControlFlagsResponse `xml:"SetVStorageObjectControlFlagsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14325,7 +15525,7 @@ func SetVStorageObjectControlFlags(ctx context.Context, r soap.RoundTripper, req type SetVirtualDiskUuidBody struct { Req *types.SetVirtualDiskUuid `xml:"urn:vim25 SetVirtualDiskUuid,omitempty"` - Res *types.SetVirtualDiskUuidResponse `xml:"urn:vim25 SetVirtualDiskUuidResponse,omitempty"` + Res *types.SetVirtualDiskUuidResponse `xml:"SetVirtualDiskUuidResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14345,7 +15545,7 @@ func SetVirtualDiskUuid(ctx context.Context, r soap.RoundTripper, req *types.Set type ShrinkVirtualDisk_TaskBody struct { Req *types.ShrinkVirtualDisk_Task `xml:"urn:vim25 ShrinkVirtualDisk_Task,omitempty"` - Res *types.ShrinkVirtualDisk_TaskResponse `xml:"urn:vim25 ShrinkVirtualDisk_TaskResponse,omitempty"` + Res *types.ShrinkVirtualDisk_TaskResponse `xml:"ShrinkVirtualDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14365,7 +15565,7 @@ func ShrinkVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *types type ShutdownGuestBody struct { Req *types.ShutdownGuest `xml:"urn:vim25 ShutdownGuest,omitempty"` - Res *types.ShutdownGuestResponse `xml:"urn:vim25 ShutdownGuestResponse,omitempty"` + Res *types.ShutdownGuestResponse `xml:"ShutdownGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14385,7 +15585,7 @@ func ShutdownGuest(ctx context.Context, r soap.RoundTripper, req *types.Shutdown type ShutdownHost_TaskBody struct { Req *types.ShutdownHost_Task `xml:"urn:vim25 ShutdownHost_Task,omitempty"` - Res *types.ShutdownHost_TaskResponse `xml:"urn:vim25 ShutdownHost_TaskResponse,omitempty"` + Res *types.ShutdownHost_TaskResponse `xml:"ShutdownHost_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14405,7 +15605,7 @@ func ShutdownHost_Task(ctx context.Context, r soap.RoundTripper, req *types.Shut type StageHostPatch_TaskBody struct { Req *types.StageHostPatch_Task `xml:"urn:vim25 StageHostPatch_Task,omitempty"` - Res *types.StageHostPatch_TaskResponse `xml:"urn:vim25 StageHostPatch_TaskResponse,omitempty"` + Res *types.StageHostPatch_TaskResponse `xml:"StageHostPatch_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14425,7 +15625,7 @@ func StageHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *types.St type StampAllRulesWithUuid_TaskBody struct { Req *types.StampAllRulesWithUuid_Task `xml:"urn:vim25 StampAllRulesWithUuid_Task,omitempty"` - Res *types.StampAllRulesWithUuid_TaskResponse `xml:"urn:vim25 StampAllRulesWithUuid_TaskResponse,omitempty"` + Res *types.StampAllRulesWithUuid_TaskResponse `xml:"StampAllRulesWithUuid_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14445,7 +15645,7 @@ func StampAllRulesWithUuid_Task(ctx context.Context, r soap.RoundTripper, req *t type StandbyGuestBody struct { Req *types.StandbyGuest `xml:"urn:vim25 StandbyGuest,omitempty"` - Res *types.StandbyGuestResponse `xml:"urn:vim25 StandbyGuestResponse,omitempty"` + Res *types.StandbyGuestResponse `xml:"StandbyGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14463,9 +15663,29 @@ func StandbyGuest(ctx context.Context, r soap.RoundTripper, req *types.StandbyGu return resBody.Res, nil } +type StartGuestNetwork_TaskBody struct { + Req *types.StartGuestNetwork_Task `xml:"urn:vim25 StartGuestNetwork_Task,omitempty"` + Res *types.StartGuestNetwork_TaskResponse `xml:"StartGuestNetwork_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *StartGuestNetwork_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func StartGuestNetwork_Task(ctx context.Context, r soap.RoundTripper, req *types.StartGuestNetwork_Task) (*types.StartGuestNetwork_TaskResponse, error) { + var reqBody, resBody StartGuestNetwork_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type StartProgramInGuestBody struct { Req *types.StartProgramInGuest `xml:"urn:vim25 StartProgramInGuest,omitempty"` - Res *types.StartProgramInGuestResponse `xml:"urn:vim25 StartProgramInGuestResponse,omitempty"` + Res *types.StartProgramInGuestResponse `xml:"StartProgramInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14485,7 +15705,7 @@ func StartProgramInGuest(ctx context.Context, r soap.RoundTripper, req *types.St type StartRecording_TaskBody struct { Req *types.StartRecording_Task `xml:"urn:vim25 StartRecording_Task,omitempty"` - Res *types.StartRecording_TaskResponse `xml:"urn:vim25 StartRecording_TaskResponse,omitempty"` + Res *types.StartRecording_TaskResponse `xml:"StartRecording_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14505,7 +15725,7 @@ func StartRecording_Task(ctx context.Context, r soap.RoundTripper, req *types.St type StartReplaying_TaskBody struct { Req *types.StartReplaying_Task `xml:"urn:vim25 StartReplaying_Task,omitempty"` - Res *types.StartReplaying_TaskResponse `xml:"urn:vim25 StartReplaying_TaskResponse,omitempty"` + Res *types.StartReplaying_TaskResponse `xml:"StartReplaying_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14525,7 +15745,7 @@ func StartReplaying_Task(ctx context.Context, r soap.RoundTripper, req *types.St type StartServiceBody struct { Req *types.StartService `xml:"urn:vim25 StartService,omitempty"` - Res *types.StartServiceResponse `xml:"urn:vim25 StartServiceResponse,omitempty"` + Res *types.StartServiceResponse `xml:"StartServiceResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14545,7 +15765,7 @@ func StartService(ctx context.Context, r soap.RoundTripper, req *types.StartServ type StopRecording_TaskBody struct { Req *types.StopRecording_Task `xml:"urn:vim25 StopRecording_Task,omitempty"` - Res *types.StopRecording_TaskResponse `xml:"urn:vim25 StopRecording_TaskResponse,omitempty"` + Res *types.StopRecording_TaskResponse `xml:"StopRecording_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14565,7 +15785,7 @@ func StopRecording_Task(ctx context.Context, r soap.RoundTripper, req *types.Sto type StopReplaying_TaskBody struct { Req *types.StopReplaying_Task `xml:"urn:vim25 StopReplaying_Task,omitempty"` - Res *types.StopReplaying_TaskResponse `xml:"urn:vim25 StopReplaying_TaskResponse,omitempty"` + Res *types.StopReplaying_TaskResponse `xml:"StopReplaying_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14585,7 +15805,7 @@ func StopReplaying_Task(ctx context.Context, r soap.RoundTripper, req *types.Sto type StopServiceBody struct { Req *types.StopService `xml:"urn:vim25 StopService,omitempty"` - Res *types.StopServiceResponse `xml:"urn:vim25 StopServiceResponse,omitempty"` + Res *types.StopServiceResponse `xml:"StopServiceResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14605,7 +15825,7 @@ func StopService(ctx context.Context, r soap.RoundTripper, req *types.StopServic type SuspendVApp_TaskBody struct { Req *types.SuspendVApp_Task `xml:"urn:vim25 SuspendVApp_Task,omitempty"` - Res *types.SuspendVApp_TaskResponse `xml:"urn:vim25 SuspendVApp_TaskResponse,omitempty"` + Res *types.SuspendVApp_TaskResponse `xml:"SuspendVApp_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14625,7 +15845,7 @@ func SuspendVApp_Task(ctx context.Context, r soap.RoundTripper, req *types.Suspe type SuspendVM_TaskBody struct { Req *types.SuspendVM_Task `xml:"urn:vim25 SuspendVM_Task,omitempty"` - Res *types.SuspendVM_TaskResponse `xml:"urn:vim25 SuspendVM_TaskResponse,omitempty"` + Res *types.SuspendVM_TaskResponse `xml:"SuspendVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14645,7 +15865,7 @@ func SuspendVM_Task(ctx context.Context, r soap.RoundTripper, req *types.Suspend type TerminateFaultTolerantVM_TaskBody struct { Req *types.TerminateFaultTolerantVM_Task `xml:"urn:vim25 TerminateFaultTolerantVM_Task,omitempty"` - Res *types.TerminateFaultTolerantVM_TaskResponse `xml:"urn:vim25 TerminateFaultTolerantVM_TaskResponse,omitempty"` + Res *types.TerminateFaultTolerantVM_TaskResponse `xml:"TerminateFaultTolerantVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14665,7 +15885,7 @@ func TerminateFaultTolerantVM_Task(ctx context.Context, r soap.RoundTripper, req type TerminateProcessInGuestBody struct { Req *types.TerminateProcessInGuest `xml:"urn:vim25 TerminateProcessInGuest,omitempty"` - Res *types.TerminateProcessInGuestResponse `xml:"urn:vim25 TerminateProcessInGuestResponse,omitempty"` + Res *types.TerminateProcessInGuestResponse `xml:"TerminateProcessInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14685,7 +15905,7 @@ func TerminateProcessInGuest(ctx context.Context, r soap.RoundTripper, req *type type TerminateSessionBody struct { Req *types.TerminateSession `xml:"urn:vim25 TerminateSession,omitempty"` - Res *types.TerminateSessionResponse `xml:"urn:vim25 TerminateSessionResponse,omitempty"` + Res *types.TerminateSessionResponse `xml:"TerminateSessionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14705,7 +15925,7 @@ func TerminateSession(ctx context.Context, r soap.RoundTripper, req *types.Termi type TerminateVMBody struct { Req *types.TerminateVM `xml:"urn:vim25 TerminateVM,omitempty"` - Res *types.TerminateVMResponse `xml:"urn:vim25 TerminateVMResponse,omitempty"` + Res *types.TerminateVMResponse `xml:"TerminateVMResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14723,9 +15943,29 @@ func TerminateVM(ctx context.Context, r soap.RoundTripper, req *types.TerminateV return resBody.Res, nil } +type TestTimeServiceBody struct { + Req *types.TestTimeService `xml:"urn:vim25 TestTimeService,omitempty"` + Res *types.TestTimeServiceResponse `xml:"TestTimeServiceResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *TestTimeServiceBody) Fault() *soap.Fault { return b.Fault_ } + +func TestTimeService(ctx context.Context, r soap.RoundTripper, req *types.TestTimeService) (*types.TestTimeServiceResponse, error) { + var reqBody, resBody TestTimeServiceBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type TurnDiskLocatorLedOff_TaskBody struct { Req *types.TurnDiskLocatorLedOff_Task `xml:"urn:vim25 TurnDiskLocatorLedOff_Task,omitempty"` - Res *types.TurnDiskLocatorLedOff_TaskResponse `xml:"urn:vim25 TurnDiskLocatorLedOff_TaskResponse,omitempty"` + Res *types.TurnDiskLocatorLedOff_TaskResponse `xml:"TurnDiskLocatorLedOff_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14745,7 +15985,7 @@ func TurnDiskLocatorLedOff_Task(ctx context.Context, r soap.RoundTripper, req *t type TurnDiskLocatorLedOn_TaskBody struct { Req *types.TurnDiskLocatorLedOn_Task `xml:"urn:vim25 TurnDiskLocatorLedOn_Task,omitempty"` - Res *types.TurnDiskLocatorLedOn_TaskResponse `xml:"urn:vim25 TurnDiskLocatorLedOn_TaskResponse,omitempty"` + Res *types.TurnDiskLocatorLedOn_TaskResponse `xml:"TurnDiskLocatorLedOn_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14765,7 +16005,7 @@ func TurnDiskLocatorLedOn_Task(ctx context.Context, r soap.RoundTripper, req *ty type TurnOffFaultToleranceForVM_TaskBody struct { Req *types.TurnOffFaultToleranceForVM_Task `xml:"urn:vim25 TurnOffFaultToleranceForVM_Task,omitempty"` - Res *types.TurnOffFaultToleranceForVM_TaskResponse `xml:"urn:vim25 TurnOffFaultToleranceForVM_TaskResponse,omitempty"` + Res *types.TurnOffFaultToleranceForVM_TaskResponse `xml:"TurnOffFaultToleranceForVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14785,7 +16025,7 @@ func TurnOffFaultToleranceForVM_Task(ctx context.Context, r soap.RoundTripper, r type UnassignUserFromGroupBody struct { Req *types.UnassignUserFromGroup `xml:"urn:vim25 UnassignUserFromGroup,omitempty"` - Res *types.UnassignUserFromGroupResponse `xml:"urn:vim25 UnassignUserFromGroupResponse,omitempty"` + Res *types.UnassignUserFromGroupResponse `xml:"UnassignUserFromGroupResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14805,7 +16045,7 @@ func UnassignUserFromGroup(ctx context.Context, r soap.RoundTripper, req *types. type UnbindVnicBody struct { Req *types.UnbindVnic `xml:"urn:vim25 UnbindVnic,omitempty"` - Res *types.UnbindVnicResponse `xml:"urn:vim25 UnbindVnicResponse,omitempty"` + Res *types.UnbindVnicResponse `xml:"UnbindVnicResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14825,7 +16065,7 @@ func UnbindVnic(ctx context.Context, r soap.RoundTripper, req *types.UnbindVnic) type UninstallHostPatch_TaskBody struct { Req *types.UninstallHostPatch_Task `xml:"urn:vim25 UninstallHostPatch_Task,omitempty"` - Res *types.UninstallHostPatch_TaskResponse `xml:"urn:vim25 UninstallHostPatch_TaskResponse,omitempty"` + Res *types.UninstallHostPatch_TaskResponse `xml:"UninstallHostPatch_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14845,7 +16085,7 @@ func UninstallHostPatch_Task(ctx context.Context, r soap.RoundTripper, req *type type UninstallIoFilter_TaskBody struct { Req *types.UninstallIoFilter_Task `xml:"urn:vim25 UninstallIoFilter_Task,omitempty"` - Res *types.UninstallIoFilter_TaskResponse `xml:"urn:vim25 UninstallIoFilter_TaskResponse,omitempty"` + Res *types.UninstallIoFilter_TaskResponse `xml:"UninstallIoFilter_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14865,7 +16105,7 @@ func UninstallIoFilter_Task(ctx context.Context, r soap.RoundTripper, req *types type UninstallServiceBody struct { Req *types.UninstallService `xml:"urn:vim25 UninstallService,omitempty"` - Res *types.UninstallServiceResponse `xml:"urn:vim25 UninstallServiceResponse,omitempty"` + Res *types.UninstallServiceResponse `xml:"UninstallServiceResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14885,7 +16125,7 @@ func UninstallService(ctx context.Context, r soap.RoundTripper, req *types.Unins type UnmapVmfsVolumeEx_TaskBody struct { Req *types.UnmapVmfsVolumeEx_Task `xml:"urn:vim25 UnmapVmfsVolumeEx_Task,omitempty"` - Res *types.UnmapVmfsVolumeEx_TaskResponse `xml:"urn:vim25 UnmapVmfsVolumeEx_TaskResponse,omitempty"` + Res *types.UnmapVmfsVolumeEx_TaskResponse `xml:"UnmapVmfsVolumeEx_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14903,9 +16143,29 @@ func UnmapVmfsVolumeEx_Task(ctx context.Context, r soap.RoundTripper, req *types return resBody.Res, nil } +type UnmarkServiceProviderEntitiesBody struct { + Req *types.UnmarkServiceProviderEntities `xml:"urn:vim25 UnmarkServiceProviderEntities,omitempty"` + Res *types.UnmarkServiceProviderEntitiesResponse `xml:"UnmarkServiceProviderEntitiesResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UnmarkServiceProviderEntitiesBody) Fault() *soap.Fault { return b.Fault_ } + +func UnmarkServiceProviderEntities(ctx context.Context, r soap.RoundTripper, req *types.UnmarkServiceProviderEntities) (*types.UnmarkServiceProviderEntitiesResponse, error) { + var reqBody, resBody UnmarkServiceProviderEntitiesBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type UnmountDiskMapping_TaskBody struct { Req *types.UnmountDiskMapping_Task `xml:"urn:vim25 UnmountDiskMapping_Task,omitempty"` - Res *types.UnmountDiskMapping_TaskResponse `xml:"urn:vim25 UnmountDiskMapping_TaskResponse,omitempty"` + Res *types.UnmountDiskMapping_TaskResponse `xml:"UnmountDiskMapping_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14925,7 +16185,7 @@ func UnmountDiskMapping_Task(ctx context.Context, r soap.RoundTripper, req *type type UnmountForceMountedVmfsVolumeBody struct { Req *types.UnmountForceMountedVmfsVolume `xml:"urn:vim25 UnmountForceMountedVmfsVolume,omitempty"` - Res *types.UnmountForceMountedVmfsVolumeResponse `xml:"urn:vim25 UnmountForceMountedVmfsVolumeResponse,omitempty"` + Res *types.UnmountForceMountedVmfsVolumeResponse `xml:"UnmountForceMountedVmfsVolumeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14945,7 +16205,7 @@ func UnmountForceMountedVmfsVolume(ctx context.Context, r soap.RoundTripper, req type UnmountToolsInstallerBody struct { Req *types.UnmountToolsInstaller `xml:"urn:vim25 UnmountToolsInstaller,omitempty"` - Res *types.UnmountToolsInstallerResponse `xml:"urn:vim25 UnmountToolsInstallerResponse,omitempty"` + Res *types.UnmountToolsInstallerResponse `xml:"UnmountToolsInstallerResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14965,7 +16225,7 @@ func UnmountToolsInstaller(ctx context.Context, r soap.RoundTripper, req *types. type UnmountVffsVolumeBody struct { Req *types.UnmountVffsVolume `xml:"urn:vim25 UnmountVffsVolume,omitempty"` - Res *types.UnmountVffsVolumeResponse `xml:"urn:vim25 UnmountVffsVolumeResponse,omitempty"` + Res *types.UnmountVffsVolumeResponse `xml:"UnmountVffsVolumeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -14985,7 +16245,7 @@ func UnmountVffsVolume(ctx context.Context, r soap.RoundTripper, req *types.Unmo type UnmountVmfsVolumeBody struct { Req *types.UnmountVmfsVolume `xml:"urn:vim25 UnmountVmfsVolume,omitempty"` - Res *types.UnmountVmfsVolumeResponse `xml:"urn:vim25 UnmountVmfsVolumeResponse,omitempty"` + Res *types.UnmountVmfsVolumeResponse `xml:"UnmountVmfsVolumeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15005,7 +16265,7 @@ func UnmountVmfsVolume(ctx context.Context, r soap.RoundTripper, req *types.Unmo type UnmountVmfsVolumeEx_TaskBody struct { Req *types.UnmountVmfsVolumeEx_Task `xml:"urn:vim25 UnmountVmfsVolumeEx_Task,omitempty"` - Res *types.UnmountVmfsVolumeEx_TaskResponse `xml:"urn:vim25 UnmountVmfsVolumeEx_TaskResponse,omitempty"` + Res *types.UnmountVmfsVolumeEx_TaskResponse `xml:"UnmountVmfsVolumeEx_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15025,7 +16285,7 @@ func UnmountVmfsVolumeEx_Task(ctx context.Context, r soap.RoundTripper, req *typ type UnregisterAndDestroy_TaskBody struct { Req *types.UnregisterAndDestroy_Task `xml:"urn:vim25 UnregisterAndDestroy_Task,omitempty"` - Res *types.UnregisterAndDestroy_TaskResponse `xml:"urn:vim25 UnregisterAndDestroy_TaskResponse,omitempty"` + Res *types.UnregisterAndDestroy_TaskResponse `xml:"UnregisterAndDestroy_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15045,7 +16305,7 @@ func UnregisterAndDestroy_Task(ctx context.Context, r soap.RoundTripper, req *ty type UnregisterExtensionBody struct { Req *types.UnregisterExtension `xml:"urn:vim25 UnregisterExtension,omitempty"` - Res *types.UnregisterExtensionResponse `xml:"urn:vim25 UnregisterExtensionResponse,omitempty"` + Res *types.UnregisterExtensionResponse `xml:"UnregisterExtensionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15065,7 +16325,7 @@ func UnregisterExtension(ctx context.Context, r soap.RoundTripper, req *types.Un type UnregisterHealthUpdateProviderBody struct { Req *types.UnregisterHealthUpdateProvider `xml:"urn:vim25 UnregisterHealthUpdateProvider,omitempty"` - Res *types.UnregisterHealthUpdateProviderResponse `xml:"urn:vim25 UnregisterHealthUpdateProviderResponse,omitempty"` + Res *types.UnregisterHealthUpdateProviderResponse `xml:"UnregisterHealthUpdateProviderResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15083,9 +16343,29 @@ func UnregisterHealthUpdateProvider(ctx context.Context, r soap.RoundTripper, re return resBody.Res, nil } +type UnregisterKmsClusterBody struct { + Req *types.UnregisterKmsCluster `xml:"urn:vim25 UnregisterKmsCluster,omitempty"` + Res *types.UnregisterKmsClusterResponse `xml:"UnregisterKmsClusterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UnregisterKmsClusterBody) Fault() *soap.Fault { return b.Fault_ } + +func UnregisterKmsCluster(ctx context.Context, r soap.RoundTripper, req *types.UnregisterKmsCluster) (*types.UnregisterKmsClusterResponse, error) { + var reqBody, resBody UnregisterKmsClusterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type UnregisterVMBody struct { Req *types.UnregisterVM `xml:"urn:vim25 UnregisterVM,omitempty"` - Res *types.UnregisterVMResponse `xml:"urn:vim25 UnregisterVMResponse,omitempty"` + Res *types.UnregisterVMResponse `xml:"UnregisterVMResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15105,7 +16385,7 @@ func UnregisterVM(ctx context.Context, r soap.RoundTripper, req *types.Unregiste type UpdateAnswerFile_TaskBody struct { Req *types.UpdateAnswerFile_Task `xml:"urn:vim25 UpdateAnswerFile_Task,omitempty"` - Res *types.UpdateAnswerFile_TaskResponse `xml:"urn:vim25 UpdateAnswerFile_TaskResponse,omitempty"` + Res *types.UpdateAnswerFile_TaskResponse `xml:"UpdateAnswerFile_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15123,9 +16403,29 @@ func UpdateAnswerFile_Task(ctx context.Context, r soap.RoundTripper, req *types. return resBody.Res, nil } +type UpdateAssignableHardwareConfigBody struct { + Req *types.UpdateAssignableHardwareConfig `xml:"urn:vim25 UpdateAssignableHardwareConfig,omitempty"` + Res *types.UpdateAssignableHardwareConfigResponse `xml:"UpdateAssignableHardwareConfigResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateAssignableHardwareConfigBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateAssignableHardwareConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateAssignableHardwareConfig) (*types.UpdateAssignableHardwareConfigResponse, error) { + var reqBody, resBody UpdateAssignableHardwareConfigBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type UpdateAssignedLicenseBody struct { Req *types.UpdateAssignedLicense `xml:"urn:vim25 UpdateAssignedLicense,omitempty"` - Res *types.UpdateAssignedLicenseResponse `xml:"urn:vim25 UpdateAssignedLicenseResponse,omitempty"` + Res *types.UpdateAssignedLicenseResponse `xml:"UpdateAssignedLicenseResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15145,7 +16445,7 @@ func UpdateAssignedLicense(ctx context.Context, r soap.RoundTripper, req *types. type UpdateAuthorizationRoleBody struct { Req *types.UpdateAuthorizationRole `xml:"urn:vim25 UpdateAuthorizationRole,omitempty"` - Res *types.UpdateAuthorizationRoleResponse `xml:"urn:vim25 UpdateAuthorizationRoleResponse,omitempty"` + Res *types.UpdateAuthorizationRoleResponse `xml:"UpdateAuthorizationRoleResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15165,7 +16465,7 @@ func UpdateAuthorizationRole(ctx context.Context, r soap.RoundTripper, req *type type UpdateBootDeviceBody struct { Req *types.UpdateBootDevice `xml:"urn:vim25 UpdateBootDevice,omitempty"` - Res *types.UpdateBootDeviceResponse `xml:"urn:vim25 UpdateBootDeviceResponse,omitempty"` + Res *types.UpdateBootDeviceResponse `xml:"UpdateBootDeviceResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15185,7 +16485,7 @@ func UpdateBootDevice(ctx context.Context, r soap.RoundTripper, req *types.Updat type UpdateChildResourceConfigurationBody struct { Req *types.UpdateChildResourceConfiguration `xml:"urn:vim25 UpdateChildResourceConfiguration,omitempty"` - Res *types.UpdateChildResourceConfigurationResponse `xml:"urn:vim25 UpdateChildResourceConfigurationResponse,omitempty"` + Res *types.UpdateChildResourceConfigurationResponse `xml:"UpdateChildResourceConfigurationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15205,7 +16505,7 @@ func UpdateChildResourceConfiguration(ctx context.Context, r soap.RoundTripper, type UpdateClusterProfileBody struct { Req *types.UpdateClusterProfile `xml:"urn:vim25 UpdateClusterProfile,omitempty"` - Res *types.UpdateClusterProfileResponse `xml:"urn:vim25 UpdateClusterProfileResponse,omitempty"` + Res *types.UpdateClusterProfileResponse `xml:"UpdateClusterProfileResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15225,7 +16525,7 @@ func UpdateClusterProfile(ctx context.Context, r soap.RoundTripper, req *types.U type UpdateConfigBody struct { Req *types.UpdateConfig `xml:"urn:vim25 UpdateConfig,omitempty"` - Res *types.UpdateConfigResponse `xml:"urn:vim25 UpdateConfigResponse,omitempty"` + Res *types.UpdateConfigResponse `xml:"UpdateConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15245,7 +16545,7 @@ func UpdateConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateCon type UpdateConsoleIpRouteConfigBody struct { Req *types.UpdateConsoleIpRouteConfig `xml:"urn:vim25 UpdateConsoleIpRouteConfig,omitempty"` - Res *types.UpdateConsoleIpRouteConfigResponse `xml:"urn:vim25 UpdateConsoleIpRouteConfigResponse,omitempty"` + Res *types.UpdateConsoleIpRouteConfigResponse `xml:"UpdateConsoleIpRouteConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15265,7 +16565,7 @@ func UpdateConsoleIpRouteConfig(ctx context.Context, r soap.RoundTripper, req *t type UpdateCounterLevelMappingBody struct { Req *types.UpdateCounterLevelMapping `xml:"urn:vim25 UpdateCounterLevelMapping,omitempty"` - Res *types.UpdateCounterLevelMappingResponse `xml:"urn:vim25 UpdateCounterLevelMappingResponse,omitempty"` + Res *types.UpdateCounterLevelMappingResponse `xml:"UpdateCounterLevelMappingResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15285,7 +16585,7 @@ func UpdateCounterLevelMapping(ctx context.Context, r soap.RoundTripper, req *ty type UpdateDVSHealthCheckConfig_TaskBody struct { Req *types.UpdateDVSHealthCheckConfig_Task `xml:"urn:vim25 UpdateDVSHealthCheckConfig_Task,omitempty"` - Res *types.UpdateDVSHealthCheckConfig_TaskResponse `xml:"urn:vim25 UpdateDVSHealthCheckConfig_TaskResponse,omitempty"` + Res *types.UpdateDVSHealthCheckConfig_TaskResponse `xml:"UpdateDVSHealthCheckConfig_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15305,7 +16605,7 @@ func UpdateDVSHealthCheckConfig_Task(ctx context.Context, r soap.RoundTripper, r type UpdateDVSLacpGroupConfig_TaskBody struct { Req *types.UpdateDVSLacpGroupConfig_Task `xml:"urn:vim25 UpdateDVSLacpGroupConfig_Task,omitempty"` - Res *types.UpdateDVSLacpGroupConfig_TaskResponse `xml:"urn:vim25 UpdateDVSLacpGroupConfig_TaskResponse,omitempty"` + Res *types.UpdateDVSLacpGroupConfig_TaskResponse `xml:"UpdateDVSLacpGroupConfig_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15325,7 +16625,7 @@ func UpdateDVSLacpGroupConfig_Task(ctx context.Context, r soap.RoundTripper, req type UpdateDateTimeBody struct { Req *types.UpdateDateTime `xml:"urn:vim25 UpdateDateTime,omitempty"` - Res *types.UpdateDateTimeResponse `xml:"urn:vim25 UpdateDateTimeResponse,omitempty"` + Res *types.UpdateDateTimeResponse `xml:"UpdateDateTimeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15345,7 +16645,7 @@ func UpdateDateTime(ctx context.Context, r soap.RoundTripper, req *types.UpdateD type UpdateDateTimeConfigBody struct { Req *types.UpdateDateTimeConfig `xml:"urn:vim25 UpdateDateTimeConfig,omitempty"` - Res *types.UpdateDateTimeConfigResponse `xml:"urn:vim25 UpdateDateTimeConfigResponse,omitempty"` + Res *types.UpdateDateTimeConfigResponse `xml:"UpdateDateTimeConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15365,7 +16665,7 @@ func UpdateDateTimeConfig(ctx context.Context, r soap.RoundTripper, req *types.U type UpdateDefaultPolicyBody struct { Req *types.UpdateDefaultPolicy `xml:"urn:vim25 UpdateDefaultPolicy,omitempty"` - Res *types.UpdateDefaultPolicyResponse `xml:"urn:vim25 UpdateDefaultPolicyResponse,omitempty"` + Res *types.UpdateDefaultPolicyResponse `xml:"UpdateDefaultPolicyResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15385,7 +16685,7 @@ func UpdateDefaultPolicy(ctx context.Context, r soap.RoundTripper, req *types.Up type UpdateDiskPartitionsBody struct { Req *types.UpdateDiskPartitions `xml:"urn:vim25 UpdateDiskPartitions,omitempty"` - Res *types.UpdateDiskPartitionsResponse `xml:"urn:vim25 UpdateDiskPartitionsResponse,omitempty"` + Res *types.UpdateDiskPartitionsResponse `xml:"UpdateDiskPartitionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15405,7 +16705,7 @@ func UpdateDiskPartitions(ctx context.Context, r soap.RoundTripper, req *types.U type UpdateDnsConfigBody struct { Req *types.UpdateDnsConfig `xml:"urn:vim25 UpdateDnsConfig,omitempty"` - Res *types.UpdateDnsConfigResponse `xml:"urn:vim25 UpdateDnsConfigResponse,omitempty"` + Res *types.UpdateDnsConfigResponse `xml:"UpdateDnsConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15425,7 +16725,7 @@ func UpdateDnsConfig(ctx context.Context, r soap.RoundTripper, req *types.Update type UpdateDvsCapabilityBody struct { Req *types.UpdateDvsCapability `xml:"urn:vim25 UpdateDvsCapability,omitempty"` - Res *types.UpdateDvsCapabilityResponse `xml:"urn:vim25 UpdateDvsCapabilityResponse,omitempty"` + Res *types.UpdateDvsCapabilityResponse `xml:"UpdateDvsCapabilityResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15445,7 +16745,7 @@ func UpdateDvsCapability(ctx context.Context, r soap.RoundTripper, req *types.Up type UpdateExtensionBody struct { Req *types.UpdateExtension `xml:"urn:vim25 UpdateExtension,omitempty"` - Res *types.UpdateExtensionResponse `xml:"urn:vim25 UpdateExtensionResponse,omitempty"` + Res *types.UpdateExtensionResponse `xml:"UpdateExtensionResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15465,7 +16765,7 @@ func UpdateExtension(ctx context.Context, r soap.RoundTripper, req *types.Update type UpdateFlagsBody struct { Req *types.UpdateFlags `xml:"urn:vim25 UpdateFlags,omitempty"` - Res *types.UpdateFlagsResponse `xml:"urn:vim25 UpdateFlagsResponse,omitempty"` + Res *types.UpdateFlagsResponse `xml:"UpdateFlagsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15485,7 +16785,7 @@ func UpdateFlags(ctx context.Context, r soap.RoundTripper, req *types.UpdateFlag type UpdateGraphicsConfigBody struct { Req *types.UpdateGraphicsConfig `xml:"urn:vim25 UpdateGraphicsConfig,omitempty"` - Res *types.UpdateGraphicsConfigResponse `xml:"urn:vim25 UpdateGraphicsConfigResponse,omitempty"` + Res *types.UpdateGraphicsConfigResponse `xml:"UpdateGraphicsConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15505,7 +16805,7 @@ func UpdateGraphicsConfig(ctx context.Context, r soap.RoundTripper, req *types.U type UpdateHostCustomizations_TaskBody struct { Req *types.UpdateHostCustomizations_Task `xml:"urn:vim25 UpdateHostCustomizations_Task,omitempty"` - Res *types.UpdateHostCustomizations_TaskResponse `xml:"urn:vim25 UpdateHostCustomizations_TaskResponse,omitempty"` + Res *types.UpdateHostCustomizations_TaskResponse `xml:"UpdateHostCustomizations_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15525,7 +16825,7 @@ func UpdateHostCustomizations_Task(ctx context.Context, r soap.RoundTripper, req type UpdateHostImageAcceptanceLevelBody struct { Req *types.UpdateHostImageAcceptanceLevel `xml:"urn:vim25 UpdateHostImageAcceptanceLevel,omitempty"` - Res *types.UpdateHostImageAcceptanceLevelResponse `xml:"urn:vim25 UpdateHostImageAcceptanceLevelResponse,omitempty"` + Res *types.UpdateHostImageAcceptanceLevelResponse `xml:"UpdateHostImageAcceptanceLevelResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15545,7 +16845,7 @@ func UpdateHostImageAcceptanceLevel(ctx context.Context, r soap.RoundTripper, re type UpdateHostProfileBody struct { Req *types.UpdateHostProfile `xml:"urn:vim25 UpdateHostProfile,omitempty"` - Res *types.UpdateHostProfileResponse `xml:"urn:vim25 UpdateHostProfileResponse,omitempty"` + Res *types.UpdateHostProfileResponse `xml:"UpdateHostProfileResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15565,7 +16865,7 @@ func UpdateHostProfile(ctx context.Context, r soap.RoundTripper, req *types.Upda type UpdateHostSpecificationBody struct { Req *types.UpdateHostSpecification `xml:"urn:vim25 UpdateHostSpecification,omitempty"` - Res *types.UpdateHostSpecificationResponse `xml:"urn:vim25 UpdateHostSpecificationResponse,omitempty"` + Res *types.UpdateHostSpecificationResponse `xml:"UpdateHostSpecificationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15585,7 +16885,7 @@ func UpdateHostSpecification(ctx context.Context, r soap.RoundTripper, req *type type UpdateHostSubSpecificationBody struct { Req *types.UpdateHostSubSpecification `xml:"urn:vim25 UpdateHostSubSpecification,omitempty"` - Res *types.UpdateHostSubSpecificationResponse `xml:"urn:vim25 UpdateHostSubSpecificationResponse,omitempty"` + Res *types.UpdateHostSubSpecificationResponse `xml:"UpdateHostSubSpecificationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15603,9 +16903,29 @@ func UpdateHostSubSpecification(ctx context.Context, r soap.RoundTripper, req *t return resBody.Res, nil } +type UpdateHppMultipathLunPolicyBody struct { + Req *types.UpdateHppMultipathLunPolicy `xml:"urn:vim25 UpdateHppMultipathLunPolicy,omitempty"` + Res *types.UpdateHppMultipathLunPolicyResponse `xml:"UpdateHppMultipathLunPolicyResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateHppMultipathLunPolicyBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateHppMultipathLunPolicy(ctx context.Context, r soap.RoundTripper, req *types.UpdateHppMultipathLunPolicy) (*types.UpdateHppMultipathLunPolicyResponse, error) { + var reqBody, resBody UpdateHppMultipathLunPolicyBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type UpdateInternetScsiAdvancedOptionsBody struct { Req *types.UpdateInternetScsiAdvancedOptions `xml:"urn:vim25 UpdateInternetScsiAdvancedOptions,omitempty"` - Res *types.UpdateInternetScsiAdvancedOptionsResponse `xml:"urn:vim25 UpdateInternetScsiAdvancedOptionsResponse,omitempty"` + Res *types.UpdateInternetScsiAdvancedOptionsResponse `xml:"UpdateInternetScsiAdvancedOptionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15625,7 +16945,7 @@ func UpdateInternetScsiAdvancedOptions(ctx context.Context, r soap.RoundTripper, type UpdateInternetScsiAliasBody struct { Req *types.UpdateInternetScsiAlias `xml:"urn:vim25 UpdateInternetScsiAlias,omitempty"` - Res *types.UpdateInternetScsiAliasResponse `xml:"urn:vim25 UpdateInternetScsiAliasResponse,omitempty"` + Res *types.UpdateInternetScsiAliasResponse `xml:"UpdateInternetScsiAliasResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15645,7 +16965,7 @@ func UpdateInternetScsiAlias(ctx context.Context, r soap.RoundTripper, req *type type UpdateInternetScsiAuthenticationPropertiesBody struct { Req *types.UpdateInternetScsiAuthenticationProperties `xml:"urn:vim25 UpdateInternetScsiAuthenticationProperties,omitempty"` - Res *types.UpdateInternetScsiAuthenticationPropertiesResponse `xml:"urn:vim25 UpdateInternetScsiAuthenticationPropertiesResponse,omitempty"` + Res *types.UpdateInternetScsiAuthenticationPropertiesResponse `xml:"UpdateInternetScsiAuthenticationPropertiesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15665,7 +16985,7 @@ func UpdateInternetScsiAuthenticationProperties(ctx context.Context, r soap.Roun type UpdateInternetScsiDigestPropertiesBody struct { Req *types.UpdateInternetScsiDigestProperties `xml:"urn:vim25 UpdateInternetScsiDigestProperties,omitempty"` - Res *types.UpdateInternetScsiDigestPropertiesResponse `xml:"urn:vim25 UpdateInternetScsiDigestPropertiesResponse,omitempty"` + Res *types.UpdateInternetScsiDigestPropertiesResponse `xml:"UpdateInternetScsiDigestPropertiesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15685,7 +17005,7 @@ func UpdateInternetScsiDigestProperties(ctx context.Context, r soap.RoundTripper type UpdateInternetScsiDiscoveryPropertiesBody struct { Req *types.UpdateInternetScsiDiscoveryProperties `xml:"urn:vim25 UpdateInternetScsiDiscoveryProperties,omitempty"` - Res *types.UpdateInternetScsiDiscoveryPropertiesResponse `xml:"urn:vim25 UpdateInternetScsiDiscoveryPropertiesResponse,omitempty"` + Res *types.UpdateInternetScsiDiscoveryPropertiesResponse `xml:"UpdateInternetScsiDiscoveryPropertiesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15705,7 +17025,7 @@ func UpdateInternetScsiDiscoveryProperties(ctx context.Context, r soap.RoundTrip type UpdateInternetScsiIPPropertiesBody struct { Req *types.UpdateInternetScsiIPProperties `xml:"urn:vim25 UpdateInternetScsiIPProperties,omitempty"` - Res *types.UpdateInternetScsiIPPropertiesResponse `xml:"urn:vim25 UpdateInternetScsiIPPropertiesResponse,omitempty"` + Res *types.UpdateInternetScsiIPPropertiesResponse `xml:"UpdateInternetScsiIPPropertiesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15725,7 +17045,7 @@ func UpdateInternetScsiIPProperties(ctx context.Context, r soap.RoundTripper, re type UpdateInternetScsiNameBody struct { Req *types.UpdateInternetScsiName `xml:"urn:vim25 UpdateInternetScsiName,omitempty"` - Res *types.UpdateInternetScsiNameResponse `xml:"urn:vim25 UpdateInternetScsiNameResponse,omitempty"` + Res *types.UpdateInternetScsiNameResponse `xml:"UpdateInternetScsiNameResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15745,7 +17065,7 @@ func UpdateInternetScsiName(ctx context.Context, r soap.RoundTripper, req *types type UpdateIpConfigBody struct { Req *types.UpdateIpConfig `xml:"urn:vim25 UpdateIpConfig,omitempty"` - Res *types.UpdateIpConfigResponse `xml:"urn:vim25 UpdateIpConfigResponse,omitempty"` + Res *types.UpdateIpConfigResponse `xml:"UpdateIpConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15765,7 +17085,7 @@ func UpdateIpConfig(ctx context.Context, r soap.RoundTripper, req *types.UpdateI type UpdateIpPoolBody struct { Req *types.UpdateIpPool `xml:"urn:vim25 UpdateIpPool,omitempty"` - Res *types.UpdateIpPoolResponse `xml:"urn:vim25 UpdateIpPoolResponse,omitempty"` + Res *types.UpdateIpPoolResponse `xml:"UpdateIpPoolResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15785,7 +17105,7 @@ func UpdateIpPool(ctx context.Context, r soap.RoundTripper, req *types.UpdateIpP type UpdateIpRouteConfigBody struct { Req *types.UpdateIpRouteConfig `xml:"urn:vim25 UpdateIpRouteConfig,omitempty"` - Res *types.UpdateIpRouteConfigResponse `xml:"urn:vim25 UpdateIpRouteConfigResponse,omitempty"` + Res *types.UpdateIpRouteConfigResponse `xml:"UpdateIpRouteConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15805,7 +17125,7 @@ func UpdateIpRouteConfig(ctx context.Context, r soap.RoundTripper, req *types.Up type UpdateIpRouteTableConfigBody struct { Req *types.UpdateIpRouteTableConfig `xml:"urn:vim25 UpdateIpRouteTableConfig,omitempty"` - Res *types.UpdateIpRouteTableConfigResponse `xml:"urn:vim25 UpdateIpRouteTableConfigResponse,omitempty"` + Res *types.UpdateIpRouteTableConfigResponse `xml:"UpdateIpRouteTableConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15825,7 +17145,7 @@ func UpdateIpRouteTableConfig(ctx context.Context, r soap.RoundTripper, req *typ type UpdateIpmiBody struct { Req *types.UpdateIpmi `xml:"urn:vim25 UpdateIpmi,omitempty"` - Res *types.UpdateIpmiResponse `xml:"urn:vim25 UpdateIpmiResponse,omitempty"` + Res *types.UpdateIpmiResponse `xml:"UpdateIpmiResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15845,7 +17165,7 @@ func UpdateIpmi(ctx context.Context, r soap.RoundTripper, req *types.UpdateIpmi) type UpdateKmipServerBody struct { Req *types.UpdateKmipServer `xml:"urn:vim25 UpdateKmipServer,omitempty"` - Res *types.UpdateKmipServerResponse `xml:"urn:vim25 UpdateKmipServerResponse,omitempty"` + Res *types.UpdateKmipServerResponse `xml:"UpdateKmipServerResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15865,7 +17185,7 @@ func UpdateKmipServer(ctx context.Context, r soap.RoundTripper, req *types.Updat type UpdateKmsSignedCsrClientCertBody struct { Req *types.UpdateKmsSignedCsrClientCert `xml:"urn:vim25 UpdateKmsSignedCsrClientCert,omitempty"` - Res *types.UpdateKmsSignedCsrClientCertResponse `xml:"urn:vim25 UpdateKmsSignedCsrClientCertResponse,omitempty"` + Res *types.UpdateKmsSignedCsrClientCertResponse `xml:"UpdateKmsSignedCsrClientCertResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15885,7 +17205,7 @@ func UpdateKmsSignedCsrClientCert(ctx context.Context, r soap.RoundTripper, req type UpdateLicenseBody struct { Req *types.UpdateLicense `xml:"urn:vim25 UpdateLicense,omitempty"` - Res *types.UpdateLicenseResponse `xml:"urn:vim25 UpdateLicenseResponse,omitempty"` + Res *types.UpdateLicenseResponse `xml:"UpdateLicenseResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15905,7 +17225,7 @@ func UpdateLicense(ctx context.Context, r soap.RoundTripper, req *types.UpdateLi type UpdateLicenseLabelBody struct { Req *types.UpdateLicenseLabel `xml:"urn:vim25 UpdateLicenseLabel,omitempty"` - Res *types.UpdateLicenseLabelResponse `xml:"urn:vim25 UpdateLicenseLabelResponse,omitempty"` + Res *types.UpdateLicenseLabelResponse `xml:"UpdateLicenseLabelResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15925,7 +17245,7 @@ func UpdateLicenseLabel(ctx context.Context, r soap.RoundTripper, req *types.Upd type UpdateLinkedChildrenBody struct { Req *types.UpdateLinkedChildren `xml:"urn:vim25 UpdateLinkedChildren,omitempty"` - Res *types.UpdateLinkedChildrenResponse `xml:"urn:vim25 UpdateLinkedChildrenResponse,omitempty"` + Res *types.UpdateLinkedChildrenResponse `xml:"UpdateLinkedChildrenResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15945,7 +17265,7 @@ func UpdateLinkedChildren(ctx context.Context, r soap.RoundTripper, req *types.U type UpdateLocalSwapDatastoreBody struct { Req *types.UpdateLocalSwapDatastore `xml:"urn:vim25 UpdateLocalSwapDatastore,omitempty"` - Res *types.UpdateLocalSwapDatastoreResponse `xml:"urn:vim25 UpdateLocalSwapDatastoreResponse,omitempty"` + Res *types.UpdateLocalSwapDatastoreResponse `xml:"UpdateLocalSwapDatastoreResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15965,7 +17285,7 @@ func UpdateLocalSwapDatastore(ctx context.Context, r soap.RoundTripper, req *typ type UpdateLockdownExceptionsBody struct { Req *types.UpdateLockdownExceptions `xml:"urn:vim25 UpdateLockdownExceptions,omitempty"` - Res *types.UpdateLockdownExceptionsResponse `xml:"urn:vim25 UpdateLockdownExceptionsResponse,omitempty"` + Res *types.UpdateLockdownExceptionsResponse `xml:"UpdateLockdownExceptionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -15985,7 +17305,7 @@ func UpdateLockdownExceptions(ctx context.Context, r soap.RoundTripper, req *typ type UpdateModuleOptionStringBody struct { Req *types.UpdateModuleOptionString `xml:"urn:vim25 UpdateModuleOptionString,omitempty"` - Res *types.UpdateModuleOptionStringResponse `xml:"urn:vim25 UpdateModuleOptionStringResponse,omitempty"` + Res *types.UpdateModuleOptionStringResponse `xml:"UpdateModuleOptionStringResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16005,7 +17325,7 @@ func UpdateModuleOptionString(ctx context.Context, r soap.RoundTripper, req *typ type UpdateNetworkConfigBody struct { Req *types.UpdateNetworkConfig `xml:"urn:vim25 UpdateNetworkConfig,omitempty"` - Res *types.UpdateNetworkConfigResponse `xml:"urn:vim25 UpdateNetworkConfigResponse,omitempty"` + Res *types.UpdateNetworkConfigResponse `xml:"UpdateNetworkConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16025,7 +17345,7 @@ func UpdateNetworkConfig(ctx context.Context, r soap.RoundTripper, req *types.Up type UpdateNetworkResourcePoolBody struct { Req *types.UpdateNetworkResourcePool `xml:"urn:vim25 UpdateNetworkResourcePool,omitempty"` - Res *types.UpdateNetworkResourcePoolResponse `xml:"urn:vim25 UpdateNetworkResourcePoolResponse,omitempty"` + Res *types.UpdateNetworkResourcePoolResponse `xml:"UpdateNetworkResourcePoolResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16045,7 +17365,7 @@ func UpdateNetworkResourcePool(ctx context.Context, r soap.RoundTripper, req *ty type UpdateOptionsBody struct { Req *types.UpdateOptions `xml:"urn:vim25 UpdateOptions,omitempty"` - Res *types.UpdateOptionsResponse `xml:"urn:vim25 UpdateOptionsResponse,omitempty"` + Res *types.UpdateOptionsResponse `xml:"UpdateOptionsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16065,7 +17385,7 @@ func UpdateOptions(ctx context.Context, r soap.RoundTripper, req *types.UpdateOp type UpdatePassthruConfigBody struct { Req *types.UpdatePassthruConfig `xml:"urn:vim25 UpdatePassthruConfig,omitempty"` - Res *types.UpdatePassthruConfigResponse `xml:"urn:vim25 UpdatePassthruConfigResponse,omitempty"` + Res *types.UpdatePassthruConfigResponse `xml:"UpdatePassthruConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16085,7 +17405,7 @@ func UpdatePassthruConfig(ctx context.Context, r soap.RoundTripper, req *types.U type UpdatePerfIntervalBody struct { Req *types.UpdatePerfInterval `xml:"urn:vim25 UpdatePerfInterval,omitempty"` - Res *types.UpdatePerfIntervalResponse `xml:"urn:vim25 UpdatePerfIntervalResponse,omitempty"` + Res *types.UpdatePerfIntervalResponse `xml:"UpdatePerfIntervalResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16105,7 +17425,7 @@ func UpdatePerfInterval(ctx context.Context, r soap.RoundTripper, req *types.Upd type UpdatePhysicalNicLinkSpeedBody struct { Req *types.UpdatePhysicalNicLinkSpeed `xml:"urn:vim25 UpdatePhysicalNicLinkSpeed,omitempty"` - Res *types.UpdatePhysicalNicLinkSpeedResponse `xml:"urn:vim25 UpdatePhysicalNicLinkSpeedResponse,omitempty"` + Res *types.UpdatePhysicalNicLinkSpeedResponse `xml:"UpdatePhysicalNicLinkSpeedResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16125,7 +17445,7 @@ func UpdatePhysicalNicLinkSpeed(ctx context.Context, r soap.RoundTripper, req *t type UpdatePortGroupBody struct { Req *types.UpdatePortGroup `xml:"urn:vim25 UpdatePortGroup,omitempty"` - Res *types.UpdatePortGroupResponse `xml:"urn:vim25 UpdatePortGroupResponse,omitempty"` + Res *types.UpdatePortGroupResponse `xml:"UpdatePortGroupResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16143,9 +17463,29 @@ func UpdatePortGroup(ctx context.Context, r soap.RoundTripper, req *types.Update return resBody.Res, nil } +type UpdateProductLockerLocation_TaskBody struct { + Req *types.UpdateProductLockerLocation_Task `xml:"urn:vim25 UpdateProductLockerLocation_Task,omitempty"` + Res *types.UpdateProductLockerLocation_TaskResponse `xml:"UpdateProductLockerLocation_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateProductLockerLocation_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateProductLockerLocation_Task(ctx context.Context, r soap.RoundTripper, req *types.UpdateProductLockerLocation_Task) (*types.UpdateProductLockerLocation_TaskResponse, error) { + var reqBody, resBody UpdateProductLockerLocation_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type UpdateProgressBody struct { Req *types.UpdateProgress `xml:"urn:vim25 UpdateProgress,omitempty"` - Res *types.UpdateProgressResponse `xml:"urn:vim25 UpdateProgressResponse,omitempty"` + Res *types.UpdateProgressResponse `xml:"UpdateProgressResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16165,7 +17505,7 @@ func UpdateProgress(ctx context.Context, r soap.RoundTripper, req *types.UpdateP type UpdateReferenceHostBody struct { Req *types.UpdateReferenceHost `xml:"urn:vim25 UpdateReferenceHost,omitempty"` - Res *types.UpdateReferenceHostResponse `xml:"urn:vim25 UpdateReferenceHostResponse,omitempty"` + Res *types.UpdateReferenceHostResponse `xml:"UpdateReferenceHostResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16185,7 +17525,7 @@ func UpdateReferenceHost(ctx context.Context, r soap.RoundTripper, req *types.Up type UpdateRulesetBody struct { Req *types.UpdateRuleset `xml:"urn:vim25 UpdateRuleset,omitempty"` - Res *types.UpdateRulesetResponse `xml:"urn:vim25 UpdateRulesetResponse,omitempty"` + Res *types.UpdateRulesetResponse `xml:"UpdateRulesetResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16205,7 +17545,7 @@ func UpdateRuleset(ctx context.Context, r soap.RoundTripper, req *types.UpdateRu type UpdateScsiLunDisplayNameBody struct { Req *types.UpdateScsiLunDisplayName `xml:"urn:vim25 UpdateScsiLunDisplayName,omitempty"` - Res *types.UpdateScsiLunDisplayNameResponse `xml:"urn:vim25 UpdateScsiLunDisplayNameResponse,omitempty"` + Res *types.UpdateScsiLunDisplayNameResponse `xml:"UpdateScsiLunDisplayNameResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16225,7 +17565,7 @@ func UpdateScsiLunDisplayName(ctx context.Context, r soap.RoundTripper, req *typ type UpdateSelfSignedClientCertBody struct { Req *types.UpdateSelfSignedClientCert `xml:"urn:vim25 UpdateSelfSignedClientCert,omitempty"` - Res *types.UpdateSelfSignedClientCertResponse `xml:"urn:vim25 UpdateSelfSignedClientCertResponse,omitempty"` + Res *types.UpdateSelfSignedClientCertResponse `xml:"UpdateSelfSignedClientCertResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16245,7 +17585,7 @@ func UpdateSelfSignedClientCert(ctx context.Context, r soap.RoundTripper, req *t type UpdateServiceConsoleVirtualNicBody struct { Req *types.UpdateServiceConsoleVirtualNic `xml:"urn:vim25 UpdateServiceConsoleVirtualNic,omitempty"` - Res *types.UpdateServiceConsoleVirtualNicResponse `xml:"urn:vim25 UpdateServiceConsoleVirtualNicResponse,omitempty"` + Res *types.UpdateServiceConsoleVirtualNicResponse `xml:"UpdateServiceConsoleVirtualNicResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16265,7 +17605,7 @@ func UpdateServiceConsoleVirtualNic(ctx context.Context, r soap.RoundTripper, re type UpdateServiceMessageBody struct { Req *types.UpdateServiceMessage `xml:"urn:vim25 UpdateServiceMessage,omitempty"` - Res *types.UpdateServiceMessageResponse `xml:"urn:vim25 UpdateServiceMessageResponse,omitempty"` + Res *types.UpdateServiceMessageResponse `xml:"UpdateServiceMessageResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16285,7 +17625,7 @@ func UpdateServiceMessage(ctx context.Context, r soap.RoundTripper, req *types.U type UpdateServicePolicyBody struct { Req *types.UpdateServicePolicy `xml:"urn:vim25 UpdateServicePolicy,omitempty"` - Res *types.UpdateServicePolicyResponse `xml:"urn:vim25 UpdateServicePolicyResponse,omitempty"` + Res *types.UpdateServicePolicyResponse `xml:"UpdateServicePolicyResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16305,7 +17645,7 @@ func UpdateServicePolicy(ctx context.Context, r soap.RoundTripper, req *types.Up type UpdateSoftwareInternetScsiEnabledBody struct { Req *types.UpdateSoftwareInternetScsiEnabled `xml:"urn:vim25 UpdateSoftwareInternetScsiEnabled,omitempty"` - Res *types.UpdateSoftwareInternetScsiEnabledResponse `xml:"urn:vim25 UpdateSoftwareInternetScsiEnabledResponse,omitempty"` + Res *types.UpdateSoftwareInternetScsiEnabledResponse `xml:"UpdateSoftwareInternetScsiEnabledResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16325,7 +17665,7 @@ func UpdateSoftwareInternetScsiEnabled(ctx context.Context, r soap.RoundTripper, type UpdateSystemResourcesBody struct { Req *types.UpdateSystemResources `xml:"urn:vim25 UpdateSystemResources,omitempty"` - Res *types.UpdateSystemResourcesResponse `xml:"urn:vim25 UpdateSystemResourcesResponse,omitempty"` + Res *types.UpdateSystemResourcesResponse `xml:"UpdateSystemResourcesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16345,7 +17685,7 @@ func UpdateSystemResources(ctx context.Context, r soap.RoundTripper, req *types. type UpdateSystemSwapConfigurationBody struct { Req *types.UpdateSystemSwapConfiguration `xml:"urn:vim25 UpdateSystemSwapConfiguration,omitempty"` - Res *types.UpdateSystemSwapConfigurationResponse `xml:"urn:vim25 UpdateSystemSwapConfigurationResponse,omitempty"` + Res *types.UpdateSystemSwapConfigurationResponse `xml:"UpdateSystemSwapConfigurationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16365,7 +17705,7 @@ func UpdateSystemSwapConfiguration(ctx context.Context, r soap.RoundTripper, req type UpdateSystemUsersBody struct { Req *types.UpdateSystemUsers `xml:"urn:vim25 UpdateSystemUsers,omitempty"` - Res *types.UpdateSystemUsersResponse `xml:"urn:vim25 UpdateSystemUsersResponse,omitempty"` + Res *types.UpdateSystemUsersResponse `xml:"UpdateSystemUsersResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16385,7 +17725,7 @@ func UpdateSystemUsers(ctx context.Context, r soap.RoundTripper, req *types.Upda type UpdateUserBody struct { Req *types.UpdateUser `xml:"urn:vim25 UpdateUser,omitempty"` - Res *types.UpdateUserResponse `xml:"urn:vim25 UpdateUserResponse,omitempty"` + Res *types.UpdateUserResponse `xml:"UpdateUserResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16405,7 +17745,7 @@ func UpdateUser(ctx context.Context, r soap.RoundTripper, req *types.UpdateUser) type UpdateVAppConfigBody struct { Req *types.UpdateVAppConfig `xml:"urn:vim25 UpdateVAppConfig,omitempty"` - Res *types.UpdateVAppConfigResponse `xml:"urn:vim25 UpdateVAppConfigResponse,omitempty"` + Res *types.UpdateVAppConfigResponse `xml:"UpdateVAppConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16425,7 +17765,7 @@ func UpdateVAppConfig(ctx context.Context, r soap.RoundTripper, req *types.Updat type UpdateVStorageInfrastructureObjectPolicy_TaskBody struct { Req *types.UpdateVStorageInfrastructureObjectPolicy_Task `xml:"urn:vim25 UpdateVStorageInfrastructureObjectPolicy_Task,omitempty"` - Res *types.UpdateVStorageInfrastructureObjectPolicy_TaskResponse `xml:"urn:vim25 UpdateVStorageInfrastructureObjectPolicy_TaskResponse,omitempty"` + Res *types.UpdateVStorageInfrastructureObjectPolicy_TaskResponse `xml:"UpdateVStorageInfrastructureObjectPolicy_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16443,9 +17783,29 @@ func UpdateVStorageInfrastructureObjectPolicy_Task(ctx context.Context, r soap.R return resBody.Res, nil } +type UpdateVStorageObjectCrypto_TaskBody struct { + Req *types.UpdateVStorageObjectCrypto_Task `xml:"urn:vim25 UpdateVStorageObjectCrypto_Task,omitempty"` + Res *types.UpdateVStorageObjectCrypto_TaskResponse `xml:"UpdateVStorageObjectCrypto_TaskResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *UpdateVStorageObjectCrypto_TaskBody) Fault() *soap.Fault { return b.Fault_ } + +func UpdateVStorageObjectCrypto_Task(ctx context.Context, r soap.RoundTripper, req *types.UpdateVStorageObjectCrypto_Task) (*types.UpdateVStorageObjectCrypto_TaskResponse, error) { + var reqBody, resBody UpdateVStorageObjectCrypto_TaskBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type UpdateVStorageObjectPolicy_TaskBody struct { Req *types.UpdateVStorageObjectPolicy_Task `xml:"urn:vim25 UpdateVStorageObjectPolicy_Task,omitempty"` - Res *types.UpdateVStorageObjectPolicy_TaskResponse `xml:"urn:vim25 UpdateVStorageObjectPolicy_TaskResponse,omitempty"` + Res *types.UpdateVStorageObjectPolicy_TaskResponse `xml:"UpdateVStorageObjectPolicy_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16465,7 +17825,7 @@ func UpdateVStorageObjectPolicy_Task(ctx context.Context, r soap.RoundTripper, r type UpdateVVolVirtualMachineFiles_TaskBody struct { Req *types.UpdateVVolVirtualMachineFiles_Task `xml:"urn:vim25 UpdateVVolVirtualMachineFiles_Task,omitempty"` - Res *types.UpdateVVolVirtualMachineFiles_TaskResponse `xml:"urn:vim25 UpdateVVolVirtualMachineFiles_TaskResponse,omitempty"` + Res *types.UpdateVVolVirtualMachineFiles_TaskResponse `xml:"UpdateVVolVirtualMachineFiles_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16485,7 +17845,7 @@ func UpdateVVolVirtualMachineFiles_Task(ctx context.Context, r soap.RoundTripper type UpdateVirtualMachineFiles_TaskBody struct { Req *types.UpdateVirtualMachineFiles_Task `xml:"urn:vim25 UpdateVirtualMachineFiles_Task,omitempty"` - Res *types.UpdateVirtualMachineFiles_TaskResponse `xml:"urn:vim25 UpdateVirtualMachineFiles_TaskResponse,omitempty"` + Res *types.UpdateVirtualMachineFiles_TaskResponse `xml:"UpdateVirtualMachineFiles_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16505,7 +17865,7 @@ func UpdateVirtualMachineFiles_Task(ctx context.Context, r soap.RoundTripper, re type UpdateVirtualNicBody struct { Req *types.UpdateVirtualNic `xml:"urn:vim25 UpdateVirtualNic,omitempty"` - Res *types.UpdateVirtualNicResponse `xml:"urn:vim25 UpdateVirtualNicResponse,omitempty"` + Res *types.UpdateVirtualNicResponse `xml:"UpdateVirtualNicResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16525,7 +17885,7 @@ func UpdateVirtualNic(ctx context.Context, r soap.RoundTripper, req *types.Updat type UpdateVirtualSwitchBody struct { Req *types.UpdateVirtualSwitch `xml:"urn:vim25 UpdateVirtualSwitch,omitempty"` - Res *types.UpdateVirtualSwitchResponse `xml:"urn:vim25 UpdateVirtualSwitchResponse,omitempty"` + Res *types.UpdateVirtualSwitchResponse `xml:"UpdateVirtualSwitchResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16545,7 +17905,7 @@ func UpdateVirtualSwitch(ctx context.Context, r soap.RoundTripper, req *types.Up type UpdateVmfsUnmapBandwidthBody struct { Req *types.UpdateVmfsUnmapBandwidth `xml:"urn:vim25 UpdateVmfsUnmapBandwidth,omitempty"` - Res *types.UpdateVmfsUnmapBandwidthResponse `xml:"urn:vim25 UpdateVmfsUnmapBandwidthResponse,omitempty"` + Res *types.UpdateVmfsUnmapBandwidthResponse `xml:"UpdateVmfsUnmapBandwidthResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16565,7 +17925,7 @@ func UpdateVmfsUnmapBandwidth(ctx context.Context, r soap.RoundTripper, req *typ type UpdateVmfsUnmapPriorityBody struct { Req *types.UpdateVmfsUnmapPriority `xml:"urn:vim25 UpdateVmfsUnmapPriority,omitempty"` - Res *types.UpdateVmfsUnmapPriorityResponse `xml:"urn:vim25 UpdateVmfsUnmapPriorityResponse,omitempty"` + Res *types.UpdateVmfsUnmapPriorityResponse `xml:"UpdateVmfsUnmapPriorityResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16585,7 +17945,7 @@ func UpdateVmfsUnmapPriority(ctx context.Context, r soap.RoundTripper, req *type type UpdateVsan_TaskBody struct { Req *types.UpdateVsan_Task `xml:"urn:vim25 UpdateVsan_Task,omitempty"` - Res *types.UpdateVsan_TaskResponse `xml:"urn:vim25 UpdateVsan_TaskResponse,omitempty"` + Res *types.UpdateVsan_TaskResponse `xml:"UpdateVsan_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16605,7 +17965,7 @@ func UpdateVsan_Task(ctx context.Context, r soap.RoundTripper, req *types.Update type UpgradeIoFilter_TaskBody struct { Req *types.UpgradeIoFilter_Task `xml:"urn:vim25 UpgradeIoFilter_Task,omitempty"` - Res *types.UpgradeIoFilter_TaskResponse `xml:"urn:vim25 UpgradeIoFilter_TaskResponse,omitempty"` + Res *types.UpgradeIoFilter_TaskResponse `xml:"UpgradeIoFilter_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16625,7 +17985,7 @@ func UpgradeIoFilter_Task(ctx context.Context, r soap.RoundTripper, req *types.U type UpgradeTools_TaskBody struct { Req *types.UpgradeTools_Task `xml:"urn:vim25 UpgradeTools_Task,omitempty"` - Res *types.UpgradeTools_TaskResponse `xml:"urn:vim25 UpgradeTools_TaskResponse,omitempty"` + Res *types.UpgradeTools_TaskResponse `xml:"UpgradeTools_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16645,7 +18005,7 @@ func UpgradeTools_Task(ctx context.Context, r soap.RoundTripper, req *types.Upgr type UpgradeVM_TaskBody struct { Req *types.UpgradeVM_Task `xml:"urn:vim25 UpgradeVM_Task,omitempty"` - Res *types.UpgradeVM_TaskResponse `xml:"urn:vim25 UpgradeVM_TaskResponse,omitempty"` + Res *types.UpgradeVM_TaskResponse `xml:"UpgradeVM_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16665,7 +18025,7 @@ func UpgradeVM_Task(ctx context.Context, r soap.RoundTripper, req *types.Upgrade type UpgradeVmLayoutBody struct { Req *types.UpgradeVmLayout `xml:"urn:vim25 UpgradeVmLayout,omitempty"` - Res *types.UpgradeVmLayoutResponse `xml:"urn:vim25 UpgradeVmLayoutResponse,omitempty"` + Res *types.UpgradeVmLayoutResponse `xml:"UpgradeVmLayoutResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16685,7 +18045,7 @@ func UpgradeVmLayout(ctx context.Context, r soap.RoundTripper, req *types.Upgrad type UpgradeVmfsBody struct { Req *types.UpgradeVmfs `xml:"urn:vim25 UpgradeVmfs,omitempty"` - Res *types.UpgradeVmfsResponse `xml:"urn:vim25 UpgradeVmfsResponse,omitempty"` + Res *types.UpgradeVmfsResponse `xml:"UpgradeVmfsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16705,7 +18065,7 @@ func UpgradeVmfs(ctx context.Context, r soap.RoundTripper, req *types.UpgradeVmf type UpgradeVsanObjectsBody struct { Req *types.UpgradeVsanObjects `xml:"urn:vim25 UpgradeVsanObjects,omitempty"` - Res *types.UpgradeVsanObjectsResponse `xml:"urn:vim25 UpgradeVsanObjectsResponse,omitempty"` + Res *types.UpgradeVsanObjectsResponse `xml:"UpgradeVsanObjectsResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16725,7 +18085,7 @@ func UpgradeVsanObjects(ctx context.Context, r soap.RoundTripper, req *types.Upg type UploadClientCertBody struct { Req *types.UploadClientCert `xml:"urn:vim25 UploadClientCert,omitempty"` - Res *types.UploadClientCertResponse `xml:"urn:vim25 UploadClientCertResponse,omitempty"` + Res *types.UploadClientCertResponse `xml:"UploadClientCertResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16745,7 +18105,7 @@ func UploadClientCert(ctx context.Context, r soap.RoundTripper, req *types.Uploa type UploadKmipServerCertBody struct { Req *types.UploadKmipServerCert `xml:"urn:vim25 UploadKmipServerCert,omitempty"` - Res *types.UploadKmipServerCertResponse `xml:"urn:vim25 UploadKmipServerCertResponse,omitempty"` + Res *types.UploadKmipServerCertResponse `xml:"UploadKmipServerCertResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16763,9 +18123,29 @@ 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:"urn:vim25 VStorageObjectCreateSnapshot_TaskResponse,omitempty"` + Res *types.VStorageObjectCreateSnapshot_TaskResponse `xml:"VStorageObjectCreateSnapshot_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16785,7 +18165,7 @@ func VStorageObjectCreateSnapshot_Task(ctx context.Context, r soap.RoundTripper, type ValidateCredentialsInGuestBody struct { Req *types.ValidateCredentialsInGuest `xml:"urn:vim25 ValidateCredentialsInGuest,omitempty"` - Res *types.ValidateCredentialsInGuestResponse `xml:"urn:vim25 ValidateCredentialsInGuestResponse,omitempty"` + Res *types.ValidateCredentialsInGuestResponse `xml:"ValidateCredentialsInGuestResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16803,9 +18183,29 @@ func ValidateCredentialsInGuest(ctx context.Context, r soap.RoundTripper, req *t return resBody.Res, nil } +type ValidateHCIConfigurationBody struct { + Req *types.ValidateHCIConfiguration `xml:"urn:vim25 ValidateHCIConfiguration,omitempty"` + Res *types.ValidateHCIConfigurationResponse `xml:"ValidateHCIConfigurationResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *ValidateHCIConfigurationBody) Fault() *soap.Fault { return b.Fault_ } + +func ValidateHCIConfiguration(ctx context.Context, r soap.RoundTripper, req *types.ValidateHCIConfiguration) (*types.ValidateHCIConfigurationResponse, error) { + var reqBody, resBody ValidateHCIConfigurationBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type ValidateHostBody struct { Req *types.ValidateHost `xml:"urn:vim25 ValidateHost,omitempty"` - Res *types.ValidateHostResponse `xml:"urn:vim25 ValidateHostResponse,omitempty"` + Res *types.ValidateHostResponse `xml:"ValidateHostResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16825,7 +18225,7 @@ func ValidateHost(ctx context.Context, r soap.RoundTripper, req *types.ValidateH type ValidateHostProfileComposition_TaskBody struct { Req *types.ValidateHostProfileComposition_Task `xml:"urn:vim25 ValidateHostProfileComposition_Task,omitempty"` - Res *types.ValidateHostProfileComposition_TaskResponse `xml:"urn:vim25 ValidateHostProfileComposition_TaskResponse,omitempty"` + Res *types.ValidateHostProfileComposition_TaskResponse `xml:"ValidateHostProfileComposition_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16845,7 +18245,7 @@ func ValidateHostProfileComposition_Task(ctx context.Context, r soap.RoundTrippe type ValidateMigrationBody struct { Req *types.ValidateMigration `xml:"urn:vim25 ValidateMigration,omitempty"` - Res *types.ValidateMigrationResponse `xml:"urn:vim25 ValidateMigrationResponse,omitempty"` + Res *types.ValidateMigrationResponse `xml:"ValidateMigrationResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16865,7 +18265,7 @@ func ValidateMigration(ctx context.Context, r soap.RoundTripper, req *types.Vali type ValidateStoragePodConfigBody struct { Req *types.ValidateStoragePodConfig `xml:"urn:vim25 ValidateStoragePodConfig,omitempty"` - Res *types.ValidateStoragePodConfigResponse `xml:"urn:vim25 ValidateStoragePodConfigResponse,omitempty"` + Res *types.ValidateStoragePodConfigResponse `xml:"ValidateStoragePodConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16883,9 +18283,29 @@ func ValidateStoragePodConfig(ctx context.Context, r soap.RoundTripper, req *typ return resBody.Res, nil } +type VstorageObjectVCenterQueryChangedDiskAreasBody struct { + Req *types.VstorageObjectVCenterQueryChangedDiskAreas `xml:"urn:vim25 VstorageObjectVCenterQueryChangedDiskAreas,omitempty"` + Res *types.VstorageObjectVCenterQueryChangedDiskAreasResponse `xml:"VstorageObjectVCenterQueryChangedDiskAreasResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *VstorageObjectVCenterQueryChangedDiskAreasBody) Fault() *soap.Fault { return b.Fault_ } + +func VstorageObjectVCenterQueryChangedDiskAreas(ctx context.Context, r soap.RoundTripper, req *types.VstorageObjectVCenterQueryChangedDiskAreas) (*types.VstorageObjectVCenterQueryChangedDiskAreasResponse, error) { + var reqBody, resBody VstorageObjectVCenterQueryChangedDiskAreasBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type WaitForUpdatesBody struct { Req *types.WaitForUpdates `xml:"urn:vim25 WaitForUpdates,omitempty"` - Res *types.WaitForUpdatesResponse `xml:"urn:vim25 WaitForUpdatesResponse,omitempty"` + Res *types.WaitForUpdatesResponse `xml:"WaitForUpdatesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16905,7 +18325,7 @@ func WaitForUpdates(ctx context.Context, r soap.RoundTripper, req *types.WaitFor type WaitForUpdatesExBody struct { Req *types.WaitForUpdatesEx `xml:"urn:vim25 WaitForUpdatesEx,omitempty"` - Res *types.WaitForUpdatesExResponse `xml:"urn:vim25 WaitForUpdatesExResponse,omitempty"` + Res *types.WaitForUpdatesExResponse `xml:"WaitForUpdatesExResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16925,7 +18345,7 @@ func WaitForUpdatesEx(ctx context.Context, r soap.RoundTripper, req *types.WaitF type XmlToCustomizationSpecItemBody struct { Req *types.XmlToCustomizationSpecItem `xml:"urn:vim25 XmlToCustomizationSpecItem,omitempty"` - Res *types.XmlToCustomizationSpecItemResponse `xml:"urn:vim25 XmlToCustomizationSpecItemResponse,omitempty"` + Res *types.XmlToCustomizationSpecItemResponse `xml:"XmlToCustomizationSpecItemResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16945,7 +18365,7 @@ func XmlToCustomizationSpecItem(ctx context.Context, r soap.RoundTripper, req *t type ZeroFillVirtualDisk_TaskBody struct { Req *types.ZeroFillVirtualDisk_Task `xml:"urn:vim25 ZeroFillVirtualDisk_Task,omitempty"` - Res *types.ZeroFillVirtualDisk_TaskResponse `xml:"urn:vim25 ZeroFillVirtualDisk_TaskResponse,omitempty"` + Res *types.ZeroFillVirtualDisk_TaskResponse `xml:"ZeroFillVirtualDisk_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16965,7 +18385,7 @@ func ZeroFillVirtualDisk_Task(ctx context.Context, r soap.RoundTripper, req *typ type ConfigureVcha_TaskBody struct { Req *types.ConfigureVcha_Task `xml:"urn:vim25 configureVcha_Task,omitempty"` - Res *types.ConfigureVcha_TaskResponse `xml:"urn:vim25 configureVcha_TaskResponse,omitempty"` + Res *types.ConfigureVcha_TaskResponse `xml:"configureVcha_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -16985,7 +18405,7 @@ func ConfigureVcha_Task(ctx context.Context, r soap.RoundTripper, req *types.Con type CreatePassiveNode_TaskBody struct { Req *types.CreatePassiveNode_Task `xml:"urn:vim25 createPassiveNode_Task,omitempty"` - Res *types.CreatePassiveNode_TaskResponse `xml:"urn:vim25 createPassiveNode_TaskResponse,omitempty"` + Res *types.CreatePassiveNode_TaskResponse `xml:"createPassiveNode_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -17005,7 +18425,7 @@ func CreatePassiveNode_Task(ctx context.Context, r soap.RoundTripper, req *types type CreateWitnessNode_TaskBody struct { Req *types.CreateWitnessNode_Task `xml:"urn:vim25 createWitnessNode_Task,omitempty"` - Res *types.CreateWitnessNode_TaskResponse `xml:"urn:vim25 createWitnessNode_TaskResponse,omitempty"` + Res *types.CreateWitnessNode_TaskResponse `xml:"createWitnessNode_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -17025,7 +18445,7 @@ func CreateWitnessNode_Task(ctx context.Context, r soap.RoundTripper, req *types type DeployVcha_TaskBody struct { Req *types.DeployVcha_Task `xml:"urn:vim25 deployVcha_Task,omitempty"` - Res *types.DeployVcha_TaskResponse `xml:"urn:vim25 deployVcha_TaskResponse,omitempty"` + Res *types.DeployVcha_TaskResponse `xml:"deployVcha_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -17045,7 +18465,7 @@ func DeployVcha_Task(ctx context.Context, r soap.RoundTripper, req *types.Deploy type DestroyVcha_TaskBody struct { Req *types.DestroyVcha_Task `xml:"urn:vim25 destroyVcha_Task,omitempty"` - Res *types.DestroyVcha_TaskResponse `xml:"urn:vim25 destroyVcha_TaskResponse,omitempty"` + Res *types.DestroyVcha_TaskResponse `xml:"destroyVcha_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -17065,7 +18485,7 @@ func DestroyVcha_Task(ctx context.Context, r soap.RoundTripper, req *types.Destr type FetchSoftwarePackagesBody struct { Req *types.FetchSoftwarePackages `xml:"urn:vim25 fetchSoftwarePackages,omitempty"` - Res *types.FetchSoftwarePackagesResponse `xml:"urn:vim25 fetchSoftwarePackagesResponse,omitempty"` + Res *types.FetchSoftwarePackagesResponse `xml:"fetchSoftwarePackagesResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -17085,7 +18505,7 @@ func FetchSoftwarePackages(ctx context.Context, r soap.RoundTripper, req *types. type GetClusterModeBody struct { Req *types.GetClusterMode `xml:"urn:vim25 getClusterMode,omitempty"` - Res *types.GetClusterModeResponse `xml:"urn:vim25 getClusterModeResponse,omitempty"` + Res *types.GetClusterModeResponse `xml:"getClusterModeResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -17105,7 +18525,7 @@ func GetClusterMode(ctx context.Context, r soap.RoundTripper, req *types.GetClus type GetVchaConfigBody struct { Req *types.GetVchaConfig `xml:"urn:vim25 getVchaConfig,omitempty"` - Res *types.GetVchaConfigResponse `xml:"urn:vim25 getVchaConfigResponse,omitempty"` + Res *types.GetVchaConfigResponse `xml:"getVchaConfigResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -17125,7 +18545,7 @@ func GetVchaConfig(ctx context.Context, r soap.RoundTripper, req *types.GetVchaC type InitiateFailover_TaskBody struct { Req *types.InitiateFailover_Task `xml:"urn:vim25 initiateFailover_Task,omitempty"` - Res *types.InitiateFailover_TaskResponse `xml:"urn:vim25 initiateFailover_TaskResponse,omitempty"` + Res *types.InitiateFailover_TaskResponse `xml:"initiateFailover_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -17145,7 +18565,7 @@ func InitiateFailover_Task(ctx context.Context, r soap.RoundTripper, req *types. type InstallDateBody struct { Req *types.InstallDate `xml:"urn:vim25 installDate,omitempty"` - Res *types.InstallDateResponse `xml:"urn:vim25 installDateResponse,omitempty"` + Res *types.InstallDateResponse `xml:"installDateResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -17165,7 +18585,7 @@ func InstallDate(ctx context.Context, r soap.RoundTripper, req *types.InstallDat type PrepareVcha_TaskBody struct { Req *types.PrepareVcha_Task `xml:"urn:vim25 prepareVcha_Task,omitempty"` - Res *types.PrepareVcha_TaskResponse `xml:"urn:vim25 prepareVcha_TaskResponse,omitempty"` + Res *types.PrepareVcha_TaskResponse `xml:"prepareVcha_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -17185,7 +18605,7 @@ func PrepareVcha_Task(ctx context.Context, r soap.RoundTripper, req *types.Prepa type QueryDatacenterConfigOptionDescriptorBody struct { Req *types.QueryDatacenterConfigOptionDescriptor `xml:"urn:vim25 queryDatacenterConfigOptionDescriptor,omitempty"` - Res *types.QueryDatacenterConfigOptionDescriptorResponse `xml:"urn:vim25 queryDatacenterConfigOptionDescriptorResponse,omitempty"` + Res *types.QueryDatacenterConfigOptionDescriptorResponse `xml:"queryDatacenterConfigOptionDescriptorResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -17205,7 +18625,7 @@ func QueryDatacenterConfigOptionDescriptor(ctx context.Context, r soap.RoundTrip type ReloadVirtualMachineFromPath_TaskBody struct { Req *types.ReloadVirtualMachineFromPath_Task `xml:"urn:vim25 reloadVirtualMachineFromPath_Task,omitempty"` - Res *types.ReloadVirtualMachineFromPath_TaskResponse `xml:"urn:vim25 reloadVirtualMachineFromPath_TaskResponse,omitempty"` + Res *types.ReloadVirtualMachineFromPath_TaskResponse `xml:"reloadVirtualMachineFromPath_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -17225,7 +18645,7 @@ func ReloadVirtualMachineFromPath_Task(ctx context.Context, r soap.RoundTripper, type SetClusterMode_TaskBody struct { Req *types.SetClusterMode_Task `xml:"urn:vim25 setClusterMode_Task,omitempty"` - Res *types.SetClusterMode_TaskResponse `xml:"urn:vim25 setClusterMode_TaskResponse,omitempty"` + Res *types.SetClusterMode_TaskResponse `xml:"setClusterMode_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -17245,7 +18665,7 @@ func SetClusterMode_Task(ctx context.Context, r soap.RoundTripper, req *types.Se type SetCustomValueBody struct { Req *types.SetCustomValue `xml:"urn:vim25 setCustomValue,omitempty"` - Res *types.SetCustomValueResponse `xml:"urn:vim25 setCustomValueResponse,omitempty"` + Res *types.SetCustomValueResponse `xml:"setCustomValueResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } @@ -17265,7 +18685,7 @@ func SetCustomValue(ctx context.Context, r soap.RoundTripper, req *types.SetCust type UnregisterVApp_TaskBody struct { Req *types.UnregisterVApp_Task `xml:"urn:vim25 unregisterVApp_Task,omitempty"` - Res *types.UnregisterVApp_TaskResponse `xml:"urn:vim25 unregisterVApp_TaskResponse,omitempty"` + Res *types.UnregisterVApp_TaskResponse `xml:"unregisterVApp_TaskResponse,omitempty"` Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` } diff --git a/vendor/github.com/vmware/govmomi/vim25/methods/unreleased.go b/vendor/github.com/vmware/govmomi/vim25/methods/unreleased.go new file mode 100644 index 00000000000..a0ffff8c327 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vim25/methods/unreleased.go @@ -0,0 +1,44 @@ +/* + Copyright (c) 2022 VMware, Inc. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES 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/vim25/soap" + "github.com/vmware/govmomi/vim25/types" +) + +type PlaceVmsXClusterBody struct { + Req *types.PlaceVmsXCluster `xml:"urn:vim25 PlaceVmsXCluster,omitempty"` + Res *types.PlaceVmsXClusterResponse `xml:"PlaceVmsXClusterResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *PlaceVmsXClusterBody) Fault() *soap.Fault { return b.Fault_ } + +func PlaceVmsXCluster(ctx context.Context, r soap.RoundTripper, req *types.PlaceVmsXCluster) (*types.PlaceVmsXClusterResponse, error) { + var reqBody, resBody PlaceVmsXClusterBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} diff --git a/vendor/github.com/vmware/govmomi/vim25/mo/mo.go b/vendor/github.com/vmware/govmomi/vim25/mo/mo.go index 4f19988e36d..f3dcb5e2992 100644 --- a/vendor/github.com/vmware/govmomi/vim25/mo/mo.go +++ b/vendor/github.com/vmware/govmomi/vim25/mo/mo.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2022 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -79,12 +79,13 @@ func init() { type ClusterComputeResource struct { ComputeResource - Configuration types.ClusterConfigInfo `mo:"configuration"` - Recommendation []types.ClusterRecommendation `mo:"recommendation"` - DrsRecommendation []types.ClusterDrsRecommendation `mo:"drsRecommendation"` - MigrationHistory []types.ClusterDrsMigration `mo:"migrationHistory"` - ActionHistory []types.ClusterActionHistory `mo:"actionHistory"` - DrsFault []types.ClusterDrsFaults `mo:"drsFault"` + Configuration types.ClusterConfigInfo `mo:"configuration"` + Recommendation []types.ClusterRecommendation `mo:"recommendation"` + DrsRecommendation []types.ClusterDrsRecommendation `mo:"drsRecommendation"` + HciConfig *types.ClusterComputeResourceHCIConfigInfo `mo:"hciConfig"` + MigrationHistory []types.ClusterDrsMigration `mo:"migrationHistory"` + ActionHistory []types.ClusterActionHistory `mo:"actionHistory"` + DrsFault []types.ClusterDrsFaults `mo:"drsFault"` } func init() { @@ -128,6 +129,7 @@ type ComputeResource struct { Summary types.BaseComputeResourceSummary `mo:"summary"` EnvironmentBrowser *types.ManagedObjectReference `mo:"environmentBrowser"` ConfigurationEx types.BaseComputeResourceConfigInfo `mo:"configurationEx"` + LifecycleManaged *bool `mo:"lifecycleManaged"` } func (m *ComputeResource) Entity() *ManagedEntity { @@ -441,6 +443,7 @@ type Folder struct { ChildType []string `mo:"childType"` ChildEntity []types.ManagedObjectReference `mo:"childEntity"` + Namespace *string `mo:"namespace"` } func (m *Folder) Entity() *ManagedEntity { @@ -577,6 +580,21 @@ func init() { t["HostActiveDirectoryAuthentication"] = reflect.TypeOf((*HostActiveDirectoryAuthentication)(nil)).Elem() } +type HostAssignableHardwareManager struct { + Self types.ManagedObjectReference + + Binding []types.HostAssignableHardwareBinding `mo:"binding"` + Config types.HostAssignableHardwareConfig `mo:"config"` +} + +func (m HostAssignableHardwareManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["HostAssignableHardwareManager"] = reflect.TypeOf((*HostAssignableHardwareManager)(nil)).Elem() +} + type HostAuthenticationManager struct { Self types.ManagedObjectReference @@ -1265,10 +1283,10 @@ func init() { type Network struct { ManagedEntity - Name string `mo:"name"` Summary types.BaseNetworkSummary `mo:"summary"` Host []types.ManagedObjectReference `mo:"host"` Vm []types.ManagedObjectReference `mo:"vm"` + Name string `mo:"name"` } func (m *Network) Entity() *ManagedEntity { @@ -1444,6 +1462,7 @@ type ResourcePool struct { ResourcePool []types.ManagedObjectReference `mo:"resourcePool"` Vm []types.ManagedObjectReference `mo:"vm"` Config types.ResourceConfigSpec `mo:"config"` + Namespace *string `mo:"namespace"` ChildConfiguration []types.ResourceConfigSpec `mo:"childConfiguration"` } @@ -1556,6 +1575,18 @@ func init() { t["SimpleCommand"] = reflect.TypeOf((*SimpleCommand)(nil)).Elem() } +type SiteInfoManager struct { + Self types.ManagedObjectReference +} + +func (m SiteInfoManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["SiteInfoManager"] = reflect.TypeOf((*SiteInfoManager)(nil)).Elem() +} + type StoragePod struct { Folder @@ -1567,6 +1598,18 @@ func init() { t["StoragePod"] = reflect.TypeOf((*StoragePod)(nil)).Elem() } +type StorageQueryManager struct { + Self types.ManagedObjectReference +} + +func (m StorageQueryManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["StorageQueryManager"] = reflect.TypeOf((*StorageQueryManager)(nil)).Elem() +} + type StorageResourceManager struct { Self types.ManagedObjectReference } @@ -1615,6 +1658,18 @@ func init() { t["TaskManager"] = reflect.TypeOf((*TaskManager)(nil)).Elem() } +type TenantTenantManager struct { + Self types.ManagedObjectReference +} + +func (m TenantTenantManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["TenantTenantManager"] = reflect.TypeOf((*TenantTenantManager)(nil)).Elem() +} + type UserDirectory struct { Self types.ManagedObjectReference @@ -1744,6 +1799,18 @@ func init() { t["VirtualMachineCompatibilityChecker"] = reflect.TypeOf((*VirtualMachineCompatibilityChecker)(nil)).Elem() } +type VirtualMachineGuestCustomizationManager struct { + Self types.ManagedObjectReference +} + +func (m VirtualMachineGuestCustomizationManager) Reference() types.ManagedObjectReference { + return m.Self +} + +func init() { + t["VirtualMachineGuestCustomizationManager"] = reflect.TypeOf((*VirtualMachineGuestCustomizationManager)(nil)).Elem() +} + type VirtualMachineProvisioningChecker struct { Self types.ManagedObjectReference } diff --git a/vendor/github.com/vmware/govmomi/vim25/mo/retrieve.go b/vendor/github.com/vmware/govmomi/vim25/mo/retrieve.go index c470c0ac0a1..e877da063a3 100644 --- a/vendor/github.com/vmware/govmomi/vim25/mo/retrieve.go +++ b/vendor/github.com/vmware/govmomi/vim25/mo/retrieve.go @@ -46,7 +46,7 @@ func ignoreMissingProperty(ref types.ManagedObjectReference, p types.MissingProp // it returns the first fault it finds there as error. If the 'MissingSet' // field is empty, it returns a pointer to a reflect.Value. It handles contain // nested properties, such as 'guest.ipAddress' or 'config.hardware'. -func ObjectContentToType(o types.ObjectContent) (interface{}, error) { +func ObjectContentToType(o types.ObjectContent, ptr ...bool) (interface{}, error) { // Expect no properties in the missing set for _, p := range o.MissingSet { if ignoreMissingProperty(o.Obj, p) { @@ -62,6 +62,9 @@ func ObjectContentToType(o types.ObjectContent) (interface{}, error) { return nil, err } + if len(ptr) == 1 && ptr[0] { + return v.Interface(), nil + } return v.Elem().Interface(), nil } @@ -81,9 +84,9 @@ func ApplyPropertyChange(obj Reference, changes []types.PropertyChange) { } } -// LoadRetrievePropertiesResponse converts the response of a call to -// RetrieveProperties to one or more managed objects. -func LoadRetrievePropertiesResponse(res *types.RetrievePropertiesResponse, dst interface{}) error { +// LoadObjectContent converts the response of a call to +// RetrieveProperties{Ex} to one or more managed objects. +func LoadObjectContent(content []types.ObjectContent, dst interface{}) error { rt := reflect.TypeOf(dst) if rt == nil || rt.Kind() != reflect.Ptr { panic("need pointer") @@ -104,7 +107,7 @@ func LoadRetrievePropertiesResponse(res *types.RetrievePropertiesResponse, dst i } if isSlice { - for _, p := range res.Returnval { + for _, p := range content { v, err := ObjectContentToType(p) if err != nil { return err @@ -123,10 +126,10 @@ func LoadRetrievePropertiesResponse(res *types.RetrievePropertiesResponse, dst i rv.Set(reflect.Append(rv, reflect.ValueOf(v))) } } else { - switch len(res.Returnval) { + switch len(content) { case 0: case 1: - v, err := ObjectContentToType(res.Returnval[0]) + v, err := ObjectContentToType(content[0]) if err != nil { return err } @@ -160,7 +163,7 @@ func RetrievePropertiesForRequest(ctx context.Context, r soap.RoundTripper, req return err } - return LoadRetrievePropertiesResponse(res, dst) + return LoadObjectContent(res.Returnval, dst) } // RetrieveProperties retrieves the properties of the managed object specified @@ -188,3 +191,65 @@ func RetrieveProperties(ctx context.Context, r soap.RoundTripper, pc, obj types. return RetrievePropertiesForRequest(ctx, r, req, dst) } + +var morType = reflect.TypeOf((*types.ManagedObjectReference)(nil)).Elem() + +// References returns all non-nil moref field values in the given struct. +// Only Anonymous struct fields are followed by default. The optional follow +// param will follow any struct fields when true. +func References(s interface{}, follow ...bool) []types.ManagedObjectReference { + var refs []types.ManagedObjectReference + rval := reflect.ValueOf(s) + rtype := rval.Type() + + if rval.Kind() == reflect.Ptr { + rval = rval.Elem() + rtype = rval.Type() + } + + for i := 0; i < rval.NumField(); i++ { + val := rval.Field(i) + finfo := rtype.Field(i) + + if finfo.Anonymous { + refs = append(refs, References(val.Interface(), follow...)...) + continue + } + if finfo.Name == "Self" { + continue + } + + ftype := val.Type() + + if ftype.Kind() == reflect.Slice { + if ftype.Elem() == morType { + s := val.Interface().([]types.ManagedObjectReference) + for i := range s { + refs = append(refs, s[i]) + } + } + continue + } + + if ftype.Kind() == reflect.Ptr { + if val.IsNil() { + continue + } + val = val.Elem() + ftype = val.Type() + } + + if ftype == morType { + refs = append(refs, val.Interface().(types.ManagedObjectReference)) + continue + } + + if len(follow) != 0 && follow[0] { + if ftype.Kind() == reflect.Struct && val.CanSet() { + refs = append(refs, References(val.Interface(), follow...)...) + } + } + } + + return refs +} diff --git a/vendor/github.com/vmware/govmomi/vim25/mo/type_info.go b/vendor/github.com/vmware/govmomi/vim25/mo/type_info.go index 661f2422810..aeb7d4a7980 100644 --- a/vendor/github.com/vmware/govmomi/vim25/mo/type_info.go +++ b/vendor/github.com/vmware/govmomi/vim25/mo/type_info.go @@ -157,7 +157,7 @@ func (t *typeInfo) build(typ reflect.Type, fn string, fi []int) { var nilValue reflect.Value -// assignValue assignes a value 'pv' to the struct pointed to by 'val', given a +// assignValue assigns a value 'pv' to the struct pointed to by 'val', given a // slice of field indices. It recurses into the struct until it finds the field // specified by the indices. It creates new values for pointer types where // needed. @@ -256,3 +256,8 @@ func (t *typeInfo) LoadFromObjectContent(o types.ObjectContent) (reflect.Value, return v, nil } + +func IsManagedObjectType(kind string) bool { + _, ok := t[kind] + return ok +} diff --git a/vendor/github.com/vmware/govmomi/vim25/progress/reader.go b/vendor/github.com/vmware/govmomi/vim25/progress/reader.go index cb184cfe99c..201333ee4b5 100644 --- a/vendor/github.com/vmware/govmomi/vim25/progress/reader.go +++ b/vendor/github.com/vmware/govmomi/vim25/progress/reader.go @@ -36,6 +36,9 @@ type readerReport struct { } func (r readerReport) Percentage() float32 { + if r.size <= 0 { + return 0 + } return 100.0 * float32(r.pos) / float32(r.size) } @@ -158,7 +161,7 @@ func bpsLoop(ch <-chan Report, dst *uint64) { // Setup timer for front of list to become stale. if e := l.Front(); e != nil { - dt := time.Second - time.Now().Sub(e.Value.(readerReport).t) + dt := time.Second - time.Since(e.Value.(readerReport).t) tch = time.After(dt) } diff --git a/vendor/github.com/vmware/govmomi/vim25/retry.go b/vendor/github.com/vmware/govmomi/vim25/retry.go index b8807eef319..bf663a10126 100644 --- a/vendor/github.com/vmware/govmomi/vim25/retry.go +++ b/vendor/github.com/vmware/govmomi/vim25/retry.go @@ -18,8 +18,6 @@ package vim25 import ( "context" - "net" - "net/url" "time" "github.com/vmware/govmomi/vim25/soap" @@ -27,46 +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 nerr net.Error - var ok bool - - // Never retry if this is not a network error. - switch rerr := err.(type) { - case *url.Error: - if nerr, ok = rerr.Err.(net.Error); !ok { + return 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 } - case net.Error: - nerr = rerr - default: - return false, 0 + return true, 0 } - - if !nerr.Temporary() { - return false, 0 - } - - // Don't retry if we're out of tries. - if n--; n <= 0 { - return false, 0 - } - - return true, 0 + 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 @@ -74,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 @@ -86,7 +94,7 @@ func Retry(roundTripper soap.RoundTripper, fn RetryFunc) soap.RoundTripper { func (r *retry) RoundTrip(ctx context.Context, req, res soap.HasFault) error { var err error - for { + for attempt := 0; attempt < r.maxRetryAttempts; attempt++ { err = r.roundTripper.RoundTrip(ctx, req, res) if err == nil { break diff --git a/vendor/github.com/vmware/govmomi/vim25/soap/client.go b/vendor/github.com/vmware/govmomi/vim25/soap/client.go index 90b9fbe16f6..e46a17f9548 100644 --- a/vendor/github.com/vmware/govmomi/vim25/soap/client.go +++ b/vendor/github.com/vmware/govmomi/vim25/soap/client.go @@ -35,11 +35,14 @@ import ( "net/url" "os" "path/filepath" + "reflect" "regexp" + "runtime" "strings" "sync" "time" + "github.com/vmware/govmomi/internal/version" "github.com/vmware/govmomi/vim25/progress" "github.com/vmware/govmomi/vim25/types" "github.com/vmware/govmomi/vim25/xml" @@ -57,6 +60,15 @@ const ( SessionCookieName = "vmware_soap_session" ) +// defaultUserAgent is the default user agent string, e.g. +// "govmomi/0.28.0 (go1.18.3;linux;amd64)" +var defaultUserAgent = fmt.Sprintf( + "%s/%s (%s)", + version.ClientName, + version.ClientVersion, + strings.Join([]string{runtime.Version(), runtime.GOOS, runtime.GOARCH}, ";"), +) + type Client struct { http.Client @@ -70,9 +82,11 @@ type Client struct { Namespace string // Vim namespace Version string // Vim version + Types types.Func UserAgent string - cookie string + cookie string + insecureCookies bool } var schemeMatch = regexp.MustCompile(`^\w+://`) @@ -122,6 +136,8 @@ func NewClient(u *url.URL, insecure bool) *Client { u: u, k: insecure, d: newDebug(), + + Types: types.TypeFunc(), } // Initialize http.RoundTripper on client, so we can customize it below @@ -140,10 +156,14 @@ func NewClient(u *url.URL, insecure bool) *Client { c.hosts = make(map[string]string) c.t.TLSClientConfig = &tls.Config{InsecureSkipVerify: c.k} - // Don't bother setting DialTLS if InsecureSkipVerify=true - if !c.k { - c.t.DialTLS = c.dialTLS - } + + // Always set DialTLS and DialTLSContext, even if InsecureSkipVerify=true, + // because of how certificate verification has been delegated to the host's + // PKI framework in Go 1.18. Please see the following links for more info: + // + // * https://tip.golang.org/doc/go1.18 (search for "Certificate.Verify") + // * https://github.com/square/certigo/issues/264 + c.t.DialTLSContext = c.dialTLSContext c.Client.Transport = c.t c.Client.Jar, _ = cookiejar.New(nil) @@ -152,9 +172,17 @@ 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 } +func (c *Client) DefaultTransport() *http.Transport { + return c.t +} + // NewServiceClient creates a NewClient with the given URL.Path and namespace. func (c *Client) NewServiceClient(path string, namespace string) *Client { vc := c.URL() @@ -169,7 +197,7 @@ func (c *Client) NewServiceClient(path string, namespace string) *Client { client := NewClient(u, c.k) client.Namespace = "urn:" + namespace - client.Transport.(*http.Transport).TLSClientConfig = c.Transport.(*http.Transport).TLSClientConfig + client.DefaultTransport().TLSClientConfig = c.DefaultTransport().TLSClientConfig if cert := c.Certificate(); cert != nil { client.SetCertificate(*cert) } @@ -195,19 +223,34 @@ func (c *Client) NewServiceClient(path string, namespace string) *Client { // Copy any query params (e.g. GOVMOMI_TUNNEL_PROXY_PORT used in testing) client.u.RawQuery = vc.RawQuery + client.UserAgent = c.UserAgent + + vimTypes := c.Types + client.Types = func(name string) (reflect.Type, bool) { + kind, ok := vimTypes(name) + if ok { + return kind, ok + } + // vim25/xml typeToString() does not have an option to include namespace prefix. + // Workaround this by re-trying the lookup with the namespace prefix. + return vimTypes(namespace + ":" + name) + } + 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) { - pem, err := ioutil.ReadFile(name) + for _, name := range filepath.SplitList(pemPaths) { + pem, err := ioutil.ReadFile(filepath.Clean(name)) if err != nil { return err } @@ -277,7 +320,7 @@ func (c *Client) LoadThumbprints(file string) error { } func (c *Client) loadThumbprints(name string) error { - f, err := os.Open(name) + f, err := os.Open(filepath.Clean(name)) if err != nil { if os.IsNotExist(err) { return nil @@ -313,7 +356,10 @@ func ThumbprintSHA1(cert *x509.Certificate) string { return strings.Join(hex, ":") } -func (c *Client) dialTLS(network string, addr string) (net.Conn, error) { +func (c *Client) dialTLSContext( + ctx context.Context, + network, addr string) (net.Conn, error) { + // Would be nice if there was a tls.Config.Verify func, // see tls.clientHandshakeState.doFullHandshake @@ -327,7 +373,20 @@ func (c *Client) dialTLS(network string, addr string) (net.Conn, error) { case x509.UnknownAuthorityError: case x509.HostnameError: default: - return nil, err + // Allow a thumbprint verification attempt if the error indicates + // the failure was due to lack of trust. + // + // Please note the err variable is not a special type of x509 or HTTP + // error that can be validated by a type assertion. The err variable is + // in fact an *errors.errorString. + switch { + case strings.HasSuffix(err.Error(), "certificate is not trusted"): + // darwin and linux + case strings.HasSuffix(err.Error(), "certificate signed by unknown authority"): + // windows + default: + return nil, err + } } thumbprint := c.Thumbprint(addr) @@ -346,12 +405,16 @@ func (c *Client) dialTLS(network string, addr string) (net.Conn, error) { if thumbprint != peer { _ = conn.Close() - return nil, fmt.Errorf("Host %q thumbprint does not match %q", addr, thumbprint) + return nil, fmt.Errorf("host %q thumbprint does not match %q", addr, thumbprint) } return conn, nil } +func (c *Client) dialTLS(network, addr string) (net.Conn, error) { + return c.dialTLSContext(context.Background(), network, addr) +} + // splitHostPort is similar to net.SplitHostPort, // but rather than return error if there isn't a ':port', // return an empty string for the port. @@ -424,6 +487,7 @@ type marshaledClient struct { Cookies []*http.Cookie URL *url.URL Insecure bool + Version string } func (c *Client) MarshalJSON() ([]byte, error) { @@ -431,6 +495,7 @@ func (c *Client) MarshalJSON() ([]byte, error) { Cookies: c.Jar.Cookies(c.u), URL: c.u, Insecure: c.k, + Version: c.Version, } return json.Marshal(m) @@ -445,6 +510,7 @@ func (c *Client) UnmarshalJSON(b []byte) error { } *c = *NewClient(m.URL, m.Insecure) + c.Version = m.Version c.Jar.SetCookies(m.URL, m.Cookies) return nil @@ -452,6 +518,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() @@ -462,12 +538,16 @@ func (c *Client) Do(ctx context.Context, req *http.Request, f func(*http.Respons defer d.done() } - if c.UserAgent != "" { - req.Header.Set(`User-Agent`, c.UserAgent) + // use default + if c.UserAgent == "" { + c.UserAgent = defaultUserAgent } + req.Header.Set(`User-Agent`, c.UserAgent) + + ext := "" if d.enabled() { - d.debugRequest(req) + ext = d.debugRequest(req) } tstart := time.Now() @@ -488,12 +568,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) + d.debugResponse(res, ext) } + if c.insecureCookies { + c.setInsecureCookies(res) + } + + defer res.Body.Close() + return f(res) } @@ -511,6 +595,32 @@ func (c *Client) WithHeader(ctx context.Context, header Header) context.Context return context.WithValue(ctx, headerContext{}, header) } +type statusError struct { + res *http.Response +} + +// Temporary returns true for HTTP response codes that can be retried +// See vim25.IsTemporaryNetworkError +func (e *statusError) Temporary() bool { + switch e.res.StatusCode { + case http.StatusBadGateway: + return true + } + return false +} + +func (e *statusError) Error() string { + return e.res.Status +} + +func newStatusError(res *http.Response) error { + return &url.Error{ + Op: res.Request.Method, + URL: res.Request.URL.Path, + Err: &statusError{res}, + } +} + func (c *Client) RoundTrip(ctx context.Context, reqBody, resBody HasFault) error { var err error var b []byte @@ -566,11 +676,11 @@ func (c *Client) RoundTrip(ctx context.Context, reqBody, resBody HasFault) error case http.StatusInternalServerError: // Error, but typically includes a body explaining the error default: - return errors.New(res.Status) + return newStatusError(res) } dec := xml.NewDecoder(res.Body) - dec.TypeFunc = types.TypeFunc() + dec.TypeFunc = c.Types err = dec.Decode(&resEnv) if err != nil { return err @@ -681,7 +791,7 @@ func (c *Client) UploadFile(ctx context.Context, file string, u *url.URL, param return err } - f, err := os.Open(file) + f, err := os.Open(filepath.Clean(file)) if err != nil { return err } @@ -734,7 +844,7 @@ func (c *Client) Download(ctx context.Context, u *url.URL, param *Download) (io. switch res.StatusCode { case http.StatusOK: default: - err = errors.New(res.Status) + err = fmt.Errorf("download(%s): %s", u, res.Status) } if err != nil { @@ -758,7 +868,7 @@ func (c *Client) WriteFile(ctx context.Context, file string, src io.Reader, size if s != nil { pr := progress.NewReader(ctx, s, src, size) - src = pr + r = pr // Mark progress reader as done when returning from this function. defer func() { diff --git a/vendor/github.com/vmware/govmomi/vim25/soap/debug.go b/vendor/github.com/vmware/govmomi/vim25/soap/debug.go index 844581b99ce..bc5b902030a 100644 --- a/vendor/github.com/vmware/govmomi/vim25/soap/debug.go +++ b/vendor/github.com/vmware/govmomi/vim25/soap/debug.go @@ -21,25 +21,19 @@ import ( "io" "net/http" "net/http/httputil" - "strings" "sync/atomic" "time" "github.com/vmware/govmomi/vim25/debug" ) -// teeReader wraps io.TeeReader and patches through the Close() function. -type teeReader struct { - io.Reader - io.Closer -} - -func newTeeReader(rc io.ReadCloser, w io.Writer) io.ReadCloser { - return teeReader{ - Reader: io.TeeReader(rc, w), - Closer: rc, +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 { @@ -71,50 +65,52 @@ func (d *debugRoundTrip) newFile(suffix string) io.WriteCloser { } func (d *debugRoundTrip) ext(h http.Header) string { + const json = "application/json" ext := "xml" - if strings.Contains(h.Get("Content-Type"), "/json") { + if h.Get("Accept") == json || h.Get("Content-Type") == json { ext = "json" } return ext } -func (d *debugRoundTrip) debugRequest(req *http.Request) { +func (d *debugRoundTrip) debugRequest(req *http.Request) string { if d == nil { - return + return "" } - var wc io.WriteCloser - // Capture headers - wc = d.newFile("req.headers") + var wc io.WriteCloser = d.newFile("req.headers") b, _ := httputil.DumpRequest(req, false) wc.Write(b) wc.Close() + ext := d.ext(req.Header) // Capture body - wc = d.newFile("req." + d.ext(req.Header)) - req.Body = newTeeReader(req.Body, wc) + wc = d.newFile("req." + ext) + if req.Body != nil { + req.Body = Trace(req.Body, wc, ext) + } // Delay closing until marked done d.cs = append(d.cs, wc) + + return ext } -func (d *debugRoundTrip) debugResponse(res *http.Response) { +func (d *debugRoundTrip) debugResponse(res *http.Response, ext string) { if d == nil { return } - var wc io.WriteCloser - // Capture headers - wc = d.newFile("res.headers") + var wc io.WriteCloser = d.newFile("res.headers") b, _ := httputil.DumpResponse(res, false) wc.Write(b) wc.Close() // Capture body - wc = d.newFile("res." + d.ext(res.Header)) - res.Body = newTeeReader(res.Body, wc) + wc = d.newFile("res." + ext) + res.Body = Trace(res.Body, wc, ext) // Delay closing until marked done d.cs = append(d.cs, wc) diff --git a/vendor/github.com/vmware/govmomi/vim25/soap/error.go b/vendor/github.com/vmware/govmomi/vim25/soap/error.go index 46111556cbd..1e1508733a5 100644 --- a/vendor/github.com/vmware/govmomi/vim25/soap/error.go +++ b/vendor/github.com/vmware/govmomi/vim25/soap/error.go @@ -17,6 +17,7 @@ limitations under the License. package soap import ( + "encoding/json" "fmt" "reflect" @@ -49,6 +50,15 @@ func (s soapFaultError) Error() string { return fmt.Sprintf("%s: %s", s.fault.Code, msg) } +func (s soapFaultError) MarshalJSON() ([]byte, error) { + out := struct { + Fault *Fault + }{ + Fault: s.fault, + } + return json.Marshal(out) +} + type vimFaultError struct { fault types.BaseMethodFault } diff --git a/vendor/github.com/vmware/govmomi/vim25/types/enum.go b/vendor/github.com/vmware/govmomi/vim25/types/enum.go index c8c5977526e..e8da547b38c 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/enum.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/enum.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2022 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -200,8 +200,7 @@ func init() { type CannotEnableVmcpForClusterReason string const ( - CannotEnableVmcpForClusterReasonAPDTimeoutDisabled = CannotEnableVmcpForClusterReason("APDTimeoutDisabled") - CannotEnableVmcpForClusterReasonIncompatibleHostVersion = CannotEnableVmcpForClusterReason("IncompatibleHostVersion") + CannotEnableVmcpForClusterReasonAPDTimeoutDisabled = CannotEnableVmcpForClusterReason("APDTimeoutDisabled") ) func init() { @@ -239,6 +238,8 @@ const ( CannotUseNetworkReasonMismatchedNetworkPolicies = CannotUseNetworkReason("MismatchedNetworkPolicies") CannotUseNetworkReasonMismatchedDvsVersionOrVendor = CannotUseNetworkReason("MismatchedDvsVersionOrVendor") CannotUseNetworkReasonVMotionToUnsupportedNetworkType = CannotUseNetworkReason("VMotionToUnsupportedNetworkType") + CannotUseNetworkReasonNetworkUnderMaintenance = CannotUseNetworkReason("NetworkUnderMaintenance") + CannotUseNetworkReasonMismatchedEnsMode = CannotUseNetworkReason("MismatchedEnsMode") ) func init() { @@ -259,6 +260,41 @@ func init() { t["CheckTestType"] = reflect.TypeOf((*CheckTestType)(nil)).Elem() } +type ClusterComputeResourceHCIWorkflowState string + +const ( + ClusterComputeResourceHCIWorkflowStateIn_progress = ClusterComputeResourceHCIWorkflowState("in_progress") + ClusterComputeResourceHCIWorkflowStateDone = ClusterComputeResourceHCIWorkflowState("done") + ClusterComputeResourceHCIWorkflowStateInvalid = ClusterComputeResourceHCIWorkflowState("invalid") +) + +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 ( + ClusterCryptoConfigInfoCryptoModeOnDemand = ClusterCryptoConfigInfoCryptoMode("onDemand") + ClusterCryptoConfigInfoCryptoModeForceEnable = ClusterCryptoConfigInfoCryptoMode("forceEnable") +) + +func init() { + t["ClusterCryptoConfigInfoCryptoMode"] = reflect.TypeOf((*ClusterCryptoConfigInfoCryptoMode)(nil)).Elem() +} + type ClusterDasAamNodeStateDasState string const ( @@ -324,6 +360,7 @@ const ( ClusterDasFdmAvailabilityStateInitializationError = ClusterDasFdmAvailabilityState("initializationError") ClusterDasFdmAvailabilityStateUninitializationError = ClusterDasFdmAvailabilityState("uninitializationError") ClusterDasFdmAvailabilityStateFdmUnreachable = ClusterDasFdmAvailabilityState("fdmUnreachable") + ClusterDasFdmAvailabilityStateRetry = ClusterDasFdmAvailabilityState("retry") ) func init() { @@ -494,6 +531,34 @@ func init() { t["ConfigSpecOperation"] = reflect.TypeOf((*ConfigSpecOperation)(nil)).Elem() } +type CryptoManagerKmipCryptoKeyStatusKeyUnavailableReason string + +const ( + CryptoManagerKmipCryptoKeyStatusKeyUnavailableReasonKeyStateMissingInCache = CryptoManagerKmipCryptoKeyStatusKeyUnavailableReason("KeyStateMissingInCache") + CryptoManagerKmipCryptoKeyStatusKeyUnavailableReasonKeyStateClusterInvalid = CryptoManagerKmipCryptoKeyStatusKeyUnavailableReason("KeyStateClusterInvalid") + CryptoManagerKmipCryptoKeyStatusKeyUnavailableReasonKeyStateClusterUnreachable = CryptoManagerKmipCryptoKeyStatusKeyUnavailableReason("KeyStateClusterUnreachable") + CryptoManagerKmipCryptoKeyStatusKeyUnavailableReasonKeyStateMissingInKMS = CryptoManagerKmipCryptoKeyStatusKeyUnavailableReason("KeyStateMissingInKMS") + CryptoManagerKmipCryptoKeyStatusKeyUnavailableReasonKeyStateNotActiveOrEnabled = CryptoManagerKmipCryptoKeyStatusKeyUnavailableReason("KeyStateNotActiveOrEnabled") + CryptoManagerKmipCryptoKeyStatusKeyUnavailableReasonKeyStateManagedByTrustAuthority = CryptoManagerKmipCryptoKeyStatusKeyUnavailableReason("KeyStateManagedByTrustAuthority") +) + +func init() { + t["CryptoManagerKmipCryptoKeyStatusKeyUnavailableReason"] = reflect.TypeOf((*CryptoManagerKmipCryptoKeyStatusKeyUnavailableReason)(nil)).Elem() +} + +type CustomizationFailedReasonCode string + +const ( + CustomizationFailedReasonCodeUserDefinedScriptDisabled = CustomizationFailedReasonCode("userDefinedScriptDisabled") + CustomizationFailedReasonCodeCustomizationDisabled = CustomizationFailedReasonCode("customizationDisabled") + CustomizationFailedReasonCodeRawDataIsNotSupported = CustomizationFailedReasonCode("rawDataIsNotSupported") + CustomizationFailedReasonCodeWrongMetadataFormat = CustomizationFailedReasonCode("wrongMetadataFormat") +) + +func init() { + t["CustomizationFailedReasonCode"] = reflect.TypeOf((*CustomizationFailedReasonCode)(nil)).Elem() +} + type CustomizationLicenseDataMode string const ( @@ -576,6 +641,8 @@ const ( DasConfigFaultDasConfigFaultReasonCreateConfigVvolFailed = DasConfigFaultDasConfigFaultReason("CreateConfigVvolFailed") DasConfigFaultDasConfigFaultReasonVSanNotSupportedOnHost = DasConfigFaultDasConfigFaultReason("VSanNotSupportedOnHost") DasConfigFaultDasConfigFaultReasonDasNetworkMisconfiguration = DasConfigFaultDasConfigFaultReason("DasNetworkMisconfiguration") + DasConfigFaultDasConfigFaultReasonSetDesiredImageSpecFailed = DasConfigFaultDasConfigFaultReason("SetDesiredImageSpecFailed") + DasConfigFaultDasConfigFaultReasonApplyHAVibsOnClusterFailed = DasConfigFaultDasConfigFaultReason("ApplyHAVibsOnClusterFailed") ) func init() { @@ -703,6 +770,17 @@ func init() { t["DisallowedChangeByServiceDisallowedChange"] = reflect.TypeOf((*DisallowedChangeByServiceDisallowedChange)(nil)).Elem() } +type DistributedVirtualPortgroupBackingType string + +const ( + DistributedVirtualPortgroupBackingTypeStandard = DistributedVirtualPortgroupBackingType("standard") + DistributedVirtualPortgroupBackingTypeNsx = DistributedVirtualPortgroupBackingType("nsx") +) + +func init() { + t["DistributedVirtualPortgroupBackingType"] = reflect.TypeOf((*DistributedVirtualPortgroupBackingType)(nil)).Elem() +} + type DistributedVirtualPortgroupMetaTagName string const ( @@ -739,6 +817,8 @@ const ( DistributedVirtualSwitchHostInfrastructureTrafficClassHbr = DistributedVirtualSwitchHostInfrastructureTrafficClass("hbr") DistributedVirtualSwitchHostInfrastructureTrafficClassVsan = DistributedVirtualSwitchHostInfrastructureTrafficClass("vsan") DistributedVirtualSwitchHostInfrastructureTrafficClassVdp = DistributedVirtualSwitchHostInfrastructureTrafficClass("vdp") + DistributedVirtualSwitchHostInfrastructureTrafficClassBackupNfc = DistributedVirtualSwitchHostInfrastructureTrafficClass("backupNfc") + DistributedVirtualSwitchHostInfrastructureTrafficClassNvmetcp = DistributedVirtualSwitchHostInfrastructureTrafficClass("nvmetcp") ) func init() { @@ -760,6 +840,17 @@ func init() { t["DistributedVirtualSwitchHostMemberHostComponentState"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberHostComponentState)(nil)).Elem() } +type DistributedVirtualSwitchHostMemberTransportZoneType string + +const ( + DistributedVirtualSwitchHostMemberTransportZoneTypeVlan = DistributedVirtualSwitchHostMemberTransportZoneType("vlan") + DistributedVirtualSwitchHostMemberTransportZoneTypeOverlay = DistributedVirtualSwitchHostMemberTransportZoneType("overlay") +) + +func init() { + t["DistributedVirtualSwitchHostMemberTransportZoneType"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberTransportZoneType)(nil)).Elem() +} + type DistributedVirtualSwitchNetworkResourceControlVersion string const ( @@ -997,6 +1088,17 @@ func init() { t["FileSystemMountInfoVStorageSupportStatus"] = reflect.TypeOf((*FileSystemMountInfoVStorageSupportStatus)(nil)).Elem() } +type FolderDesiredHostState string + +const ( + FolderDesiredHostStateMaintenance = FolderDesiredHostState("maintenance") + FolderDesiredHostStateNon_maintenance = FolderDesiredHostState("non_maintenance") +) + +func init() { + t["FolderDesiredHostState"] = reflect.TypeOf((*FolderDesiredHostState)(nil)).Elem() +} + type FtIssuesOnHostHostSelectionType string const ( @@ -1033,6 +1135,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 ( @@ -1060,6 +1176,16 @@ func init() { t["GuestOsDescriptorSupportLevel"] = reflect.TypeOf((*GuestOsDescriptorSupportLevel)(nil)).Elem() } +type GuestQuiesceEndGuestQuiesceError string + +const ( + GuestQuiesceEndGuestQuiesceErrorFailure = GuestQuiesceEndGuestQuiesceError("failure") +) + +func init() { + t["GuestQuiesceEndGuestQuiesceError"] = reflect.TypeOf((*GuestQuiesceEndGuestQuiesceError)(nil)).Elem() +} + type GuestRegKeyWowSpec string const ( @@ -1213,6 +1339,7 @@ const ( HostCpuPackageVendorUnknown = HostCpuPackageVendor("unknown") HostCpuPackageVendorIntel = HostCpuPackageVendor("intel") HostCpuPackageVendorAmd = HostCpuPackageVendor("amd") + HostCpuPackageVendorHygon = HostCpuPackageVendor("hygon") ) func init() { @@ -1234,15 +1361,27 @@ func init() { type HostCryptoState string const ( - HostCryptoStateIncapable = HostCryptoState("incapable") - HostCryptoStatePrepared = HostCryptoState("prepared") - HostCryptoStateSafe = HostCryptoState("safe") + HostCryptoStateIncapable = HostCryptoState("incapable") + HostCryptoStatePrepared = HostCryptoState("prepared") + HostCryptoStateSafe = HostCryptoState("safe") + HostCryptoStatePendingIncapable = HostCryptoState("pendingIncapable") ) func init() { t["HostCryptoState"] = reflect.TypeOf((*HostCryptoState)(nil)).Elem() } +type HostDVSConfigSpecSwitchMode string + +const ( + HostDVSConfigSpecSwitchModeNormal = HostDVSConfigSpecSwitchMode("normal") + HostDVSConfigSpecSwitchModeMux = HostDVSConfigSpecSwitchMode("mux") +) + +func init() { + t["HostDVSConfigSpecSwitchMode"] = reflect.TypeOf((*HostDVSConfigSpecSwitchMode)(nil)).Elem() +} + type HostDasErrorEventHostDasErrorReason string const ( @@ -1260,6 +1399,17 @@ func init() { t["HostDasErrorEventHostDasErrorReason"] = reflect.TypeOf((*HostDasErrorEventHostDasErrorReason)(nil)).Elem() } +type HostDateTimeInfoProtocol string + +const ( + HostDateTimeInfoProtocolNtp = HostDateTimeInfoProtocol("ntp") + HostDateTimeInfoProtocolPtp = HostDateTimeInfoProtocol("ptp") +) + +func init() { + t["HostDateTimeInfoProtocol"] = reflect.TypeOf((*HostDateTimeInfoProtocol)(nil)).Elem() +} + type HostDigestInfoDigestMethodType string const ( @@ -1275,6 +1425,19 @@ func init() { t["HostDigestInfoDigestMethodType"] = reflect.TypeOf((*HostDigestInfoDigestMethodType)(nil)).Elem() } +type HostDigestVerificationSetting string + +const ( + HostDigestVerificationSettingDigestDisabled = HostDigestVerificationSetting("digestDisabled") + HostDigestVerificationSettingHeaderOnly = HostDigestVerificationSetting("headerOnly") + HostDigestVerificationSettingDataOnly = HostDigestVerificationSetting("dataOnly") + HostDigestVerificationSettingHeaderAndData = HostDigestVerificationSetting("headerAndData") +) + +func init() { + t["HostDigestVerificationSetting"] = reflect.TypeOf((*HostDigestVerificationSetting)(nil)).Elem() +} + type HostDisconnectedEventReasonCode string const ( @@ -1343,6 +1506,7 @@ const ( HostFileSystemVolumeFileSystemTypeVFFS = HostFileSystemVolumeFileSystemType("VFFS") HostFileSystemVolumeFileSystemTypeVVOL = HostFileSystemVolumeFileSystemType("VVOL") HostFileSystemVolumeFileSystemTypePMEM = HostFileSystemVolumeFileSystemType("PMEM") + HostFileSystemVolumeFileSystemTypeVsanD = HostFileSystemVolumeFileSystemType("vsanD") HostFileSystemVolumeFileSystemTypeOTHER = HostFileSystemVolumeFileSystemType("OTHER") ) @@ -1383,6 +1547,18 @@ func init() { t["HostFirewallRuleProtocol"] = reflect.TypeOf((*HostFirewallRuleProtocol)(nil)).Elem() } +type HostFruFruType string + +const ( + HostFruFruTypeUndefined = HostFruFruType("undefined") + HostFruFruTypeBoard = HostFruFruType("board") + HostFruFruTypeProduct = HostFruFruType("product") +) + +func init() { + t["HostFruFruType"] = reflect.TypeOf((*HostFruFruType)(nil)).Elem() +} + type HostGraphicsConfigGraphicsType string const ( @@ -1632,6 +1808,50 @@ func init() { t["HostLowLevelProvisioningManagerReloadTarget"] = reflect.TypeOf((*HostLowLevelProvisioningManagerReloadTarget)(nil)).Elem() } +type HostMaintenanceSpecPurpose string + +const ( + HostMaintenanceSpecPurposeHostUpgrade = HostMaintenanceSpecPurpose("hostUpgrade") +) + +func init() { + t["HostMaintenanceSpecPurpose"] = reflect.TypeOf((*HostMaintenanceSpecPurpose)(nil)).Elem() +} + +type HostMemoryTierFlags string + +const ( + HostMemoryTierFlagsMemoryTier = HostMemoryTierFlags("memoryTier") + HostMemoryTierFlagsPersistentTier = HostMemoryTierFlags("persistentTier") + HostMemoryTierFlagsCachingTier = HostMemoryTierFlags("cachingTier") +) + +func init() { + t["HostMemoryTierFlags"] = reflect.TypeOf((*HostMemoryTierFlags)(nil)).Elem() +} + +type HostMemoryTierType string + +const ( + HostMemoryTierTypeDRAM = HostMemoryTierType("DRAM") + HostMemoryTierTypePMem = HostMemoryTierType("PMem") +) + +func init() { + t["HostMemoryTierType"] = reflect.TypeOf((*HostMemoryTierType)(nil)).Elem() +} + +type HostMemoryTieringType string + +const ( + HostMemoryTieringTypeNoTiering = HostMemoryTieringType("noTiering") + HostMemoryTieringTypeHardwareTiering = HostMemoryTieringType("hardwareTiering") +) + +func init() { + t["HostMemoryTieringType"] = reflect.TypeOf((*HostMemoryTieringType)(nil)).Elem() +} + type HostMountInfoInaccessibleReason string const ( @@ -1644,6 +1864,24 @@ func init() { t["HostMountInfoInaccessibleReason"] = reflect.TypeOf((*HostMountInfoInaccessibleReason)(nil)).Elem() } +type HostMountInfoMountFailedReason string + +const ( + HostMountInfoMountFailedReasonCONNECT_FAILURE = HostMountInfoMountFailedReason("CONNECT_FAILURE") + HostMountInfoMountFailedReasonMOUNT_NOT_SUPPORTED = HostMountInfoMountFailedReason("MOUNT_NOT_SUPPORTED") + HostMountInfoMountFailedReasonNFS_NOT_SUPPORTED = HostMountInfoMountFailedReason("NFS_NOT_SUPPORTED") + HostMountInfoMountFailedReasonMOUNT_DENIED = HostMountInfoMountFailedReason("MOUNT_DENIED") + HostMountInfoMountFailedReasonMOUNT_NOT_DIR = HostMountInfoMountFailedReason("MOUNT_NOT_DIR") + HostMountInfoMountFailedReasonVOLUME_LIMIT_EXCEEDED = HostMountInfoMountFailedReason("VOLUME_LIMIT_EXCEEDED") + HostMountInfoMountFailedReasonCONN_LIMIT_EXCEEDED = HostMountInfoMountFailedReason("CONN_LIMIT_EXCEEDED") + HostMountInfoMountFailedReasonMOUNT_EXISTS = HostMountInfoMountFailedReason("MOUNT_EXISTS") + HostMountInfoMountFailedReasonOTHERS = HostMountInfoMountFailedReason("OTHERS") +) + +func init() { + t["HostMountInfoMountFailedReason"] = reflect.TypeOf((*HostMountInfoMountFailedReason)(nil)).Elem() +} + type HostMountMode string const ( @@ -1684,6 +1922,8 @@ const ( HostNetStackInstanceSystemStackKeyDefaultTcpipStack = HostNetStackInstanceSystemStackKey("defaultTcpipStack") HostNetStackInstanceSystemStackKeyVmotion = HostNetStackInstanceSystemStackKey("vmotion") HostNetStackInstanceSystemStackKeyVSphereProvisioning = HostNetStackInstanceSystemStackKey("vSphereProvisioning") + HostNetStackInstanceSystemStackKeyMirror = HostNetStackInstanceSystemStackKey("mirror") + HostNetStackInstanceSystemStackKeyOps = HostNetStackInstanceSystemStackKey("ops") ) func init() { @@ -1725,12 +1965,66 @@ func init() { t["HostNumericSensorType"] = reflect.TypeOf((*HostNumericSensorType)(nil)).Elem() } +type HostNvmeDiscoveryLogSubsystemType string + +const ( + HostNvmeDiscoveryLogSubsystemTypeDiscovery = HostNvmeDiscoveryLogSubsystemType("discovery") + HostNvmeDiscoveryLogSubsystemTypeNvm = HostNvmeDiscoveryLogSubsystemType("nvm") +) + +func init() { + t["HostNvmeDiscoveryLogSubsystemType"] = reflect.TypeOf((*HostNvmeDiscoveryLogSubsystemType)(nil)).Elem() +} + +type HostNvmeDiscoveryLogTransportRequirements string + +const ( + HostNvmeDiscoveryLogTransportRequirementsSecureChannelRequired = HostNvmeDiscoveryLogTransportRequirements("secureChannelRequired") + HostNvmeDiscoveryLogTransportRequirementsSecureChannelNotRequired = HostNvmeDiscoveryLogTransportRequirements("secureChannelNotRequired") + HostNvmeDiscoveryLogTransportRequirementsRequirementsNotSpecified = HostNvmeDiscoveryLogTransportRequirements("requirementsNotSpecified") +) + +func init() { + t["HostNvmeDiscoveryLogTransportRequirements"] = reflect.TypeOf((*HostNvmeDiscoveryLogTransportRequirements)(nil)).Elem() +} + +type HostNvmeTransportParametersNvmeAddressFamily string + +const ( + HostNvmeTransportParametersNvmeAddressFamilyIpv4 = HostNvmeTransportParametersNvmeAddressFamily("ipv4") + HostNvmeTransportParametersNvmeAddressFamilyIpv6 = HostNvmeTransportParametersNvmeAddressFamily("ipv6") + HostNvmeTransportParametersNvmeAddressFamilyInfiniBand = HostNvmeTransportParametersNvmeAddressFamily("infiniBand") + HostNvmeTransportParametersNvmeAddressFamilyFc = HostNvmeTransportParametersNvmeAddressFamily("fc") + HostNvmeTransportParametersNvmeAddressFamilyLoopback = HostNvmeTransportParametersNvmeAddressFamily("loopback") + HostNvmeTransportParametersNvmeAddressFamilyUnknown = HostNvmeTransportParametersNvmeAddressFamily("unknown") +) + +func init() { + t["HostNvmeTransportParametersNvmeAddressFamily"] = reflect.TypeOf((*HostNvmeTransportParametersNvmeAddressFamily)(nil)).Elem() +} + +type HostNvmeTransportType string + +const ( + HostNvmeTransportTypePcie = HostNvmeTransportType("pcie") + HostNvmeTransportTypeFibreChannel = HostNvmeTransportType("fibreChannel") + HostNvmeTransportTypeRdma = HostNvmeTransportType("rdma") + HostNvmeTransportTypeTcp = HostNvmeTransportType("tcp") + HostNvmeTransportTypeLoopback = HostNvmeTransportType("loopback") + HostNvmeTransportTypeUnsupported = HostNvmeTransportType("unsupported") +) + +func init() { + t["HostNvmeTransportType"] = reflect.TypeOf((*HostNvmeTransportType)(nil)).Elem() +} + type HostOpaqueSwitchOpaqueSwitchState string const ( - HostOpaqueSwitchOpaqueSwitchStateUp = HostOpaqueSwitchOpaqueSwitchState("up") - HostOpaqueSwitchOpaqueSwitchStateWarning = HostOpaqueSwitchOpaqueSwitchState("warning") - HostOpaqueSwitchOpaqueSwitchStateDown = HostOpaqueSwitchOpaqueSwitchState("down") + HostOpaqueSwitchOpaqueSwitchStateUp = HostOpaqueSwitchOpaqueSwitchState("up") + HostOpaqueSwitchOpaqueSwitchStateWarning = HostOpaqueSwitchOpaqueSwitchState("warning") + HostOpaqueSwitchOpaqueSwitchStateDown = HostOpaqueSwitchOpaqueSwitchState("down") + HostOpaqueSwitchOpaqueSwitchStateMaintenance = HostOpaqueSwitchOpaqueSwitchState("maintenance") ) func init() { @@ -1883,6 +2177,44 @@ func init() { t["HostProtocolEndpointProtocolEndpointType"] = reflect.TypeOf((*HostProtocolEndpointProtocolEndpointType)(nil)).Elem() } +type HostPtpConfigDeviceType string + +const ( + HostPtpConfigDeviceTypeNone = HostPtpConfigDeviceType("none") + HostPtpConfigDeviceTypeVirtualNic = HostPtpConfigDeviceType("virtualNic") + HostPtpConfigDeviceTypePciPassthruNic = HostPtpConfigDeviceType("pciPassthruNic") +) + +func init() { + t["HostPtpConfigDeviceType"] = reflect.TypeOf((*HostPtpConfigDeviceType)(nil)).Elem() +} + +type HostQualifiedNameType string + +const ( + HostQualifiedNameTypeNvmeQualifiedName = HostQualifiedNameType("nvmeQualifiedName") + HostQualifiedNameTypeVvolNvmeQualifiedName = HostQualifiedNameType("vvolNvmeQualifiedName") +) + +func init() { + t["HostQualifiedNameType"] = reflect.TypeOf((*HostQualifiedNameType)(nil)).Elem() +} + +type HostRdmaDeviceConnectionState string + +const ( + HostRdmaDeviceConnectionStateUnknown = HostRdmaDeviceConnectionState("unknown") + HostRdmaDeviceConnectionStateDown = HostRdmaDeviceConnectionState("down") + HostRdmaDeviceConnectionStateInit = HostRdmaDeviceConnectionState("init") + HostRdmaDeviceConnectionStateArmed = HostRdmaDeviceConnectionState("armed") + HostRdmaDeviceConnectionStateActive = HostRdmaDeviceConnectionState("active") + HostRdmaDeviceConnectionStateActiveDefer = HostRdmaDeviceConnectionState("activeDefer") +) + +func init() { + t["HostRdmaDeviceConnectionState"] = reflect.TypeOf((*HostRdmaDeviceConnectionState)(nil)).Elem() +} + type HostReplayUnsupportedReason string const ( @@ -1911,6 +2243,29 @@ func init() { t["HostRuntimeInfoNetStackInstanceRuntimeInfoState"] = reflect.TypeOf((*HostRuntimeInfoNetStackInstanceRuntimeInfoState)(nil)).Elem() } +type HostRuntimeInfoStateEncryptionInfoProtectionMode string + +const ( + HostRuntimeInfoStateEncryptionInfoProtectionModeNone = HostRuntimeInfoStateEncryptionInfoProtectionMode("none") + HostRuntimeInfoStateEncryptionInfoProtectionModeTpm = HostRuntimeInfoStateEncryptionInfoProtectionMode("tpm") +) + +func init() { + t["HostRuntimeInfoStateEncryptionInfoProtectionMode"] = reflect.TypeOf((*HostRuntimeInfoStateEncryptionInfoProtectionMode)(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 ( @@ -1923,6 +2278,70 @@ 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 ( + HostSgxInfoFlcModesOff = HostSgxInfoFlcModes("off") + HostSgxInfoFlcModesLocked = HostSgxInfoFlcModes("locked") + HostSgxInfoFlcModesUnlocked = HostSgxInfoFlcModes("unlocked") +) + +func init() { + t["HostSgxInfoFlcModes"] = reflect.TypeOf((*HostSgxInfoFlcModes)(nil)).Elem() +} + +type HostSgxInfoSgxStates string + +const ( + HostSgxInfoSgxStatesNotPresent = HostSgxInfoSgxStates("notPresent") + HostSgxInfoSgxStatesDisabledBIOS = HostSgxInfoSgxStates("disabledBIOS") + HostSgxInfoSgxStatesDisabledCFW101 = HostSgxInfoSgxStates("disabledCFW101") + HostSgxInfoSgxStatesDisabledCPUMismatch = HostSgxInfoSgxStates("disabledCPUMismatch") + HostSgxInfoSgxStatesDisabledNoFLC = HostSgxInfoSgxStates("disabledNoFLC") + HostSgxInfoSgxStatesDisabledNUMAUnsup = HostSgxInfoSgxStates("disabledNUMAUnsup") + HostSgxInfoSgxStatesDisabledMaxEPCRegs = HostSgxInfoSgxStates("disabledMaxEPCRegs") + HostSgxInfoSgxStatesEnabled = HostSgxInfoSgxStates("enabled") +) + +func init() { + t["HostSgxInfoSgxStates"] = reflect.TypeOf((*HostSgxInfoSgxStates)(nil)).Elem() +} + +type HostSgxRegistrationInfoRegistrationStatus string + +const ( + HostSgxRegistrationInfoRegistrationStatusNotApplicable = HostSgxRegistrationInfoRegistrationStatus("notApplicable") + HostSgxRegistrationInfoRegistrationStatusIncomplete = HostSgxRegistrationInfoRegistrationStatus("incomplete") + HostSgxRegistrationInfoRegistrationStatusComplete = HostSgxRegistrationInfoRegistrationStatus("complete") +) + +func init() { + t["HostSgxRegistrationInfoRegistrationStatus"] = reflect.TypeOf((*HostSgxRegistrationInfoRegistrationStatus)(nil)).Elem() +} + +type HostSgxRegistrationInfoRegistrationType string + +const ( + HostSgxRegistrationInfoRegistrationTypeManifest = HostSgxRegistrationInfoRegistrationType("manifest") + HostSgxRegistrationInfoRegistrationTypeAddPackage = HostSgxRegistrationInfoRegistrationType("addPackage") +) + +func init() { + t["HostSgxRegistrationInfoRegistrationType"] = reflect.TypeOf((*HostSgxRegistrationInfoRegistrationType)(nil)).Elem() +} + type HostSnmpAgentCapability string const ( @@ -1948,6 +2367,17 @@ func init() { t["HostStandbyMode"] = reflect.TypeOf((*HostStandbyMode)(nil)).Elem() } +type HostStorageProtocol string + +const ( + HostStorageProtocolScsi = HostStorageProtocol("scsi") + HostStorageProtocolNvme = HostStorageProtocol("nvme") +) + +func init() { + t["HostStorageProtocol"] = reflect.TypeOf((*HostStorageProtocol)(nil)).Elem() +} + type HostSystemConnectionState string const ( @@ -1963,9 +2393,11 @@ func init() { type HostSystemIdentificationInfoIdentifier string const ( - HostSystemIdentificationInfoIdentifierAssetTag = HostSystemIdentificationInfoIdentifier("AssetTag") - HostSystemIdentificationInfoIdentifierServiceTag = HostSystemIdentificationInfoIdentifier("ServiceTag") - HostSystemIdentificationInfoIdentifierOemSpecificString = HostSystemIdentificationInfoIdentifier("OemSpecificString") + HostSystemIdentificationInfoIdentifierAssetTag = HostSystemIdentificationInfoIdentifier("AssetTag") + HostSystemIdentificationInfoIdentifierServiceTag = HostSystemIdentificationInfoIdentifier("ServiceTag") + HostSystemIdentificationInfoIdentifierOemSpecificString = HostSystemIdentificationInfoIdentifier("OemSpecificString") + HostSystemIdentificationInfoIdentifierEnclosureSerialNumberTag = HostSystemIdentificationInfoIdentifier("EnclosureSerialNumberTag") + HostSystemIdentificationInfoIdentifierSerialNumberTag = HostSystemIdentificationInfoIdentifier("SerialNumberTag") ) func init() { @@ -2011,6 +2443,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 ( @@ -2044,6 +2488,10 @@ const ( HostVirtualNicManagerNicTypeVsan = HostVirtualNicManagerNicType("vsan") HostVirtualNicManagerNicTypeVSphereProvisioning = HostVirtualNicManagerNicType("vSphereProvisioning") HostVirtualNicManagerNicTypeVsanWitness = HostVirtualNicManagerNicType("vsanWitness") + HostVirtualNicManagerNicTypeVSphereBackupNFC = HostVirtualNicManagerNicType("vSphereBackupNFC") + HostVirtualNicManagerNicTypePtp = HostVirtualNicManagerNicType("ptp") + HostVirtualNicManagerNicTypeNvmeTcp = HostVirtualNicManagerNicType("nvmeTcp") + HostVirtualNicManagerNicTypeNvmeRdma = HostVirtualNicManagerNicType("nvmeRdma") ) func init() { @@ -2187,6 +2635,7 @@ const ( IoFilterTypeInspection = IoFilterType("inspection") IoFilterTypeDatastoreIoControl = IoFilterType("datastoreIoControl") IoFilterTypeDataProvider = IoFilterType("dataProvider") + IoFilterTypeDataCapture = IoFilterType("dataCapture") ) func init() { @@ -2206,6 +2655,19 @@ func init() { t["IscsiPortInfoPathStatus"] = reflect.TypeOf((*IscsiPortInfoPathStatus)(nil)).Elem() } +type KmipClusterInfoKmsManagementType string + +const ( + KmipClusterInfoKmsManagementTypeUnknown = KmipClusterInfoKmsManagementType("unknown") + KmipClusterInfoKmsManagementTypeVCenter = KmipClusterInfoKmsManagementType("vCenter") + KmipClusterInfoKmsManagementTypeTrustAuthority = KmipClusterInfoKmsManagementType("trustAuthority") + KmipClusterInfoKmsManagementTypeNativeProvider = KmipClusterInfoKmsManagementType("nativeProvider") +) + +func init() { + t["KmipClusterInfoKmsManagementType"] = reflect.TypeOf((*KmipClusterInfoKmsManagementType)(nil)).Elem() +} + type LatencySensitivitySensitivityLevel string const ( @@ -2487,6 +2949,32 @@ func init() { t["NvdimmInterleaveSetState"] = reflect.TypeOf((*NvdimmInterleaveSetState)(nil)).Elem() } +type NvdimmNamespaceDetailsHealthStatus string + +const ( + NvdimmNamespaceDetailsHealthStatusNormal = NvdimmNamespaceDetailsHealthStatus("normal") + NvdimmNamespaceDetailsHealthStatusMissing = NvdimmNamespaceDetailsHealthStatus("missing") + NvdimmNamespaceDetailsHealthStatusLabelMissing = NvdimmNamespaceDetailsHealthStatus("labelMissing") + NvdimmNamespaceDetailsHealthStatusInterleaveBroken = NvdimmNamespaceDetailsHealthStatus("interleaveBroken") + NvdimmNamespaceDetailsHealthStatusLabelInconsistent = NvdimmNamespaceDetailsHealthStatus("labelInconsistent") +) + +func init() { + t["NvdimmNamespaceDetailsHealthStatus"] = reflect.TypeOf((*NvdimmNamespaceDetailsHealthStatus)(nil)).Elem() +} + +type NvdimmNamespaceDetailsState string + +const ( + NvdimmNamespaceDetailsStateInvalid = NvdimmNamespaceDetailsState("invalid") + NvdimmNamespaceDetailsStateNotInUse = NvdimmNamespaceDetailsState("notInUse") + NvdimmNamespaceDetailsStateInUse = NvdimmNamespaceDetailsState("inUse") +) + +func init() { + t["NvdimmNamespaceDetailsState"] = reflect.TypeOf((*NvdimmNamespaceDetailsState)(nil)).Elem() +} + type NvdimmNamespaceHealthStatus string const ( @@ -2651,6 +3139,8 @@ const ( PerformanceManagerUnitWatt = PerformanceManagerUnit("watt") PerformanceManagerUnitJoule = PerformanceManagerUnit("joule") PerformanceManagerUnitTeraBytes = PerformanceManagerUnit("teraBytes") + PerformanceManagerUnitCelsius = PerformanceManagerUnit("celsius") + PerformanceManagerUnitNanosecond = PerformanceManagerUnit("nanosecond") ) func init() { @@ -2841,6 +3331,10 @@ const ( RecommendationReasonCodeHostExitDegradation = RecommendationReasonCode("hostExitDegradation") RecommendationReasonCodeMaxVmsConstraint = RecommendationReasonCode("maxVmsConstraint") RecommendationReasonCodeFtConstraints = RecommendationReasonCode("ftConstraints") + RecommendationReasonCodeVmHostAffinityPolicy = RecommendationReasonCode("vmHostAffinityPolicy") + RecommendationReasonCodeVmHostAntiAffinityPolicy = RecommendationReasonCode("vmHostAntiAffinityPolicy") + RecommendationReasonCodeVmAntiAffinityPolicy = RecommendationReasonCode("vmAntiAffinityPolicy") + RecommendationReasonCodeBalanceVsanUsage = RecommendationReasonCode("balanceVsanUsage") ) func init() { @@ -2943,6 +3437,17 @@ func init() { t["ReplicationVmState"] = reflect.TypeOf((*ReplicationVmState)(nil)).Elem() } +type ResourceConfigSpecScaleSharesBehavior string + +const ( + ResourceConfigSpecScaleSharesBehaviorDisabled = ResourceConfigSpecScaleSharesBehavior("disabled") + ResourceConfigSpecScaleSharesBehaviorScaleCpuAndMemoryShares = ResourceConfigSpecScaleSharesBehavior("scaleCpuAndMemoryShares") +) + +func init() { + t["ResourceConfigSpecScaleSharesBehavior"] = reflect.TypeOf((*ResourceConfigSpecScaleSharesBehavior)(nil)).Elem() +} + type ScheduledHardwareUpgradeInfoHardwareUpgradePolicy string const ( @@ -3046,6 +3551,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 ( @@ -3430,6 +3947,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 ( @@ -3526,6 +4054,17 @@ func init() { t["VirtualAppVAppState"] = reflect.TypeOf((*VirtualAppVAppState)(nil)).Elem() } +type VirtualDeviceConfigSpecChangeMode string + +const ( + VirtualDeviceConfigSpecChangeModeFail = VirtualDeviceConfigSpecChangeMode("fail") + VirtualDeviceConfigSpecChangeModeSkip = VirtualDeviceConfigSpecChangeMode("skip") +) + +func init() { + t["VirtualDeviceConfigSpecChangeMode"] = reflect.TypeOf((*VirtualDeviceConfigSpecChangeMode)(nil)).Elem() +} + type VirtualDeviceConfigSpecFileOperation string const ( @@ -3752,6 +4291,17 @@ func init() { t["VirtualEthernetCardMacType"] = reflect.TypeOf((*VirtualEthernetCardMacType)(nil)).Elem() } +type VirtualHardwareMotherboardLayout string + +const ( + VirtualHardwareMotherboardLayoutI440bxHostBridge = VirtualHardwareMotherboardLayout("i440bxHostBridge") + VirtualHardwareMotherboardLayoutAcpiHostBridges = VirtualHardwareMotherboardLayout("acpiHostBridges") +) + +func init() { + t["VirtualHardwareMotherboardLayout"] = reflect.TypeOf((*VirtualHardwareMotherboardLayout)(nil)).Elem() +} + type VirtualMachineAppHeartbeatStatusType string const ( @@ -3775,6 +4325,27 @@ func init() { t["VirtualMachineBootOptionsNetworkBootProtocolType"] = reflect.TypeOf((*VirtualMachineBootOptionsNetworkBootProtocolType)(nil)).Elem() } +type VirtualMachineCertThumbprintHashAlgorithm string + +const ( + VirtualMachineCertThumbprintHashAlgorithmSha256 = VirtualMachineCertThumbprintHashAlgorithm("sha256") +) + +func init() { + t["VirtualMachineCertThumbprintHashAlgorithm"] = reflect.TypeOf((*VirtualMachineCertThumbprintHashAlgorithm)(nil)).Elem() +} + +type VirtualMachineCloneSpecTpmProvisionPolicy string + +const ( + VirtualMachineCloneSpecTpmProvisionPolicyCopy = VirtualMachineCloneSpecTpmProvisionPolicy("copy") + VirtualMachineCloneSpecTpmProvisionPolicyReplace = VirtualMachineCloneSpecTpmProvisionPolicy("replace") +) + +func init() { + t["VirtualMachineCloneSpecTpmProvisionPolicy"] = reflect.TypeOf((*VirtualMachineCloneSpecTpmProvisionPolicy)(nil)).Elem() +} + type VirtualMachineConfigInfoNpivWwnType string const ( @@ -3799,6 +4370,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 ( @@ -3913,29 +4496,31 @@ func init() { type VirtualMachineFileLayoutExFileType string const ( - VirtualMachineFileLayoutExFileTypeConfig = VirtualMachineFileLayoutExFileType("config") - VirtualMachineFileLayoutExFileTypeExtendedConfig = VirtualMachineFileLayoutExFileType("extendedConfig") - VirtualMachineFileLayoutExFileTypeDiskDescriptor = VirtualMachineFileLayoutExFileType("diskDescriptor") - VirtualMachineFileLayoutExFileTypeDiskExtent = VirtualMachineFileLayoutExFileType("diskExtent") - VirtualMachineFileLayoutExFileTypeDigestDescriptor = VirtualMachineFileLayoutExFileType("digestDescriptor") - VirtualMachineFileLayoutExFileTypeDigestExtent = VirtualMachineFileLayoutExFileType("digestExtent") - VirtualMachineFileLayoutExFileTypeDiskReplicationState = VirtualMachineFileLayoutExFileType("diskReplicationState") - VirtualMachineFileLayoutExFileTypeLog = VirtualMachineFileLayoutExFileType("log") - VirtualMachineFileLayoutExFileTypeStat = VirtualMachineFileLayoutExFileType("stat") - VirtualMachineFileLayoutExFileTypeNamespaceData = VirtualMachineFileLayoutExFileType("namespaceData") - VirtualMachineFileLayoutExFileTypeNvram = VirtualMachineFileLayoutExFileType("nvram") - VirtualMachineFileLayoutExFileTypeSnapshotData = VirtualMachineFileLayoutExFileType("snapshotData") - VirtualMachineFileLayoutExFileTypeSnapshotMemory = VirtualMachineFileLayoutExFileType("snapshotMemory") - VirtualMachineFileLayoutExFileTypeSnapshotList = VirtualMachineFileLayoutExFileType("snapshotList") - VirtualMachineFileLayoutExFileTypeSnapshotManifestList = VirtualMachineFileLayoutExFileType("snapshotManifestList") - VirtualMachineFileLayoutExFileTypeSuspend = VirtualMachineFileLayoutExFileType("suspend") - VirtualMachineFileLayoutExFileTypeSuspendMemory = VirtualMachineFileLayoutExFileType("suspendMemory") - VirtualMachineFileLayoutExFileTypeSwap = VirtualMachineFileLayoutExFileType("swap") - VirtualMachineFileLayoutExFileTypeUwswap = VirtualMachineFileLayoutExFileType("uwswap") - VirtualMachineFileLayoutExFileTypeCore = VirtualMachineFileLayoutExFileType("core") - VirtualMachineFileLayoutExFileTypeScreenshot = VirtualMachineFileLayoutExFileType("screenshot") - VirtualMachineFileLayoutExFileTypeFtMetadata = VirtualMachineFileLayoutExFileType("ftMetadata") - VirtualMachineFileLayoutExFileTypeGuestCustomization = VirtualMachineFileLayoutExFileType("guestCustomization") + VirtualMachineFileLayoutExFileTypeConfig = VirtualMachineFileLayoutExFileType("config") + VirtualMachineFileLayoutExFileTypeExtendedConfig = VirtualMachineFileLayoutExFileType("extendedConfig") + VirtualMachineFileLayoutExFileTypeDiskDescriptor = VirtualMachineFileLayoutExFileType("diskDescriptor") + VirtualMachineFileLayoutExFileTypeDiskExtent = VirtualMachineFileLayoutExFileType("diskExtent") + VirtualMachineFileLayoutExFileTypeDigestDescriptor = VirtualMachineFileLayoutExFileType("digestDescriptor") + VirtualMachineFileLayoutExFileTypeDigestExtent = VirtualMachineFileLayoutExFileType("digestExtent") + VirtualMachineFileLayoutExFileTypeDiskReplicationState = VirtualMachineFileLayoutExFileType("diskReplicationState") + VirtualMachineFileLayoutExFileTypeLog = VirtualMachineFileLayoutExFileType("log") + VirtualMachineFileLayoutExFileTypeStat = VirtualMachineFileLayoutExFileType("stat") + VirtualMachineFileLayoutExFileTypeNamespaceData = VirtualMachineFileLayoutExFileType("namespaceData") + VirtualMachineFileLayoutExFileTypeDataSetsDiskModeStore = VirtualMachineFileLayoutExFileType("dataSetsDiskModeStore") + VirtualMachineFileLayoutExFileTypeDataSetsVmModeStore = VirtualMachineFileLayoutExFileType("dataSetsVmModeStore") + VirtualMachineFileLayoutExFileTypeNvram = VirtualMachineFileLayoutExFileType("nvram") + VirtualMachineFileLayoutExFileTypeSnapshotData = VirtualMachineFileLayoutExFileType("snapshotData") + VirtualMachineFileLayoutExFileTypeSnapshotMemory = VirtualMachineFileLayoutExFileType("snapshotMemory") + VirtualMachineFileLayoutExFileTypeSnapshotList = VirtualMachineFileLayoutExFileType("snapshotList") + VirtualMachineFileLayoutExFileTypeSnapshotManifestList = VirtualMachineFileLayoutExFileType("snapshotManifestList") + VirtualMachineFileLayoutExFileTypeSuspend = VirtualMachineFileLayoutExFileType("suspend") + VirtualMachineFileLayoutExFileTypeSuspendMemory = VirtualMachineFileLayoutExFileType("suspendMemory") + VirtualMachineFileLayoutExFileTypeSwap = VirtualMachineFileLayoutExFileType("swap") + VirtualMachineFileLayoutExFileTypeUwswap = VirtualMachineFileLayoutExFileType("uwswap") + VirtualMachineFileLayoutExFileTypeCore = VirtualMachineFileLayoutExFileType("core") + VirtualMachineFileLayoutExFileTypeScreenshot = VirtualMachineFileLayoutExFileType("screenshot") + VirtualMachineFileLayoutExFileTypeFtMetadata = VirtualMachineFileLayoutExFileType("ftMetadata") + VirtualMachineFileLayoutExFileTypeGuestCustomization = VirtualMachineFileLayoutExFileType("guestCustomization") ) func init() { @@ -4008,167 +4593,201 @@ 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") - 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") - 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") - VirtualMachineGuestOsIdentifierVmkernelGuest = VirtualMachineGuestOsIdentifier("vmkernelGuest") - VirtualMachineGuestOsIdentifierVmkernel5Guest = VirtualMachineGuestOsIdentifier("vmkernel5Guest") - VirtualMachineGuestOsIdentifierVmkernel6Guest = VirtualMachineGuestOsIdentifier("vmkernel6Guest") - VirtualMachineGuestOsIdentifierVmkernel65Guest = VirtualMachineGuestOsIdentifier("vmkernel65Guest") - 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") + VirtualMachineGuestOsIdentifierWindows11_64Guest = VirtualMachineGuestOsIdentifier("windows11_64Guest") + VirtualMachineGuestOsIdentifierWindows12_64Guest = VirtualMachineGuestOsIdentifier("windows12_64Guest") + VirtualMachineGuestOsIdentifierWindowsHyperVGuest = VirtualMachineGuestOsIdentifier("windowsHyperVGuest") + VirtualMachineGuestOsIdentifierWindows2019srv_64Guest = VirtualMachineGuestOsIdentifier("windows2019srv_64Guest") + VirtualMachineGuestOsIdentifierWindows2019srvNext_64Guest = VirtualMachineGuestOsIdentifier("windows2019srvNext_64Guest") + VirtualMachineGuestOsIdentifierWindows2022srvNext_64Guest = VirtualMachineGuestOsIdentifier("windows2022srvNext_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") + VirtualMachineGuestOsIdentifierFreebsd14Guest = VirtualMachineGuestOsIdentifier("freebsd14Guest") + VirtualMachineGuestOsIdentifierFreebsd14_64Guest = VirtualMachineGuestOsIdentifier("freebsd14_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") + VirtualMachineGuestOsIdentifierDebian12Guest = VirtualMachineGuestOsIdentifier("debian12Guest") + VirtualMachineGuestOsIdentifierDebian12_64Guest = VirtualMachineGuestOsIdentifier("debian12_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") + VirtualMachineGuestOsIdentifierOther6xLinuxGuest = VirtualMachineGuestOsIdentifier("other6xLinuxGuest") + VirtualMachineGuestOsIdentifierGenericLinuxGuest = VirtualMachineGuestOsIdentifier("genericLinuxGuest") + VirtualMachineGuestOsIdentifierOther24xLinux64Guest = VirtualMachineGuestOsIdentifier("other24xLinux64Guest") + VirtualMachineGuestOsIdentifierOther26xLinux64Guest = VirtualMachineGuestOsIdentifier("other26xLinux64Guest") + VirtualMachineGuestOsIdentifierOther3xLinux64Guest = VirtualMachineGuestOsIdentifier("other3xLinux64Guest") + VirtualMachineGuestOsIdentifierOther4xLinux64Guest = VirtualMachineGuestOsIdentifier("other4xLinux64Guest") + VirtualMachineGuestOsIdentifierOther5xLinux64Guest = VirtualMachineGuestOsIdentifier("other5xLinux64Guest") + VirtualMachineGuestOsIdentifierOther6xLinux64Guest = VirtualMachineGuestOsIdentifier("other6xLinux64Guest") + 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") + VirtualMachineGuestOsIdentifierDarwin22_64Guest = VirtualMachineGuestOsIdentifier("darwin22_64Guest") + VirtualMachineGuestOsIdentifierDarwin23_64Guest = VirtualMachineGuestOsIdentifier("darwin23_64Guest") + VirtualMachineGuestOsIdentifierVmkernelGuest = VirtualMachineGuestOsIdentifier("vmkernelGuest") + VirtualMachineGuestOsIdentifierVmkernel5Guest = VirtualMachineGuestOsIdentifier("vmkernel5Guest") + VirtualMachineGuestOsIdentifierVmkernel6Guest = VirtualMachineGuestOsIdentifier("vmkernel6Guest") + VirtualMachineGuestOsIdentifierVmkernel65Guest = VirtualMachineGuestOsIdentifier("vmkernel65Guest") + VirtualMachineGuestOsIdentifierVmkernel7Guest = VirtualMachineGuestOsIdentifier("vmkernel7Guest") + VirtualMachineGuestOsIdentifierVmkernel8Guest = VirtualMachineGuestOsIdentifier("vmkernel8Guest") + VirtualMachineGuestOsIdentifierAmazonlinux2_64Guest = VirtualMachineGuestOsIdentifier("amazonlinux2_64Guest") + VirtualMachineGuestOsIdentifierAmazonlinux3_64Guest = VirtualMachineGuestOsIdentifier("amazonlinux3_64Guest") + VirtualMachineGuestOsIdentifierCrxPod1Guest = VirtualMachineGuestOsIdentifier("crxPod1Guest") + VirtualMachineGuestOsIdentifierRockylinux_64Guest = VirtualMachineGuestOsIdentifier("rockylinux_64Guest") + VirtualMachineGuestOsIdentifierAlmalinux_64Guest = VirtualMachineGuestOsIdentifier("almalinux_64Guest") + VirtualMachineGuestOsIdentifierOtherGuest = VirtualMachineGuestOsIdentifier("otherGuest") + VirtualMachineGuestOsIdentifierOtherGuest64 = VirtualMachineGuestOsIdentifier("otherGuest64") ) func init() { @@ -4358,6 +4977,17 @@ func init() { t["VirtualMachineScsiPassthroughType"] = reflect.TypeOf((*VirtualMachineScsiPassthroughType)(nil)).Elem() } +type VirtualMachineSgxInfoFlcModes string + +const ( + VirtualMachineSgxInfoFlcModesLocked = VirtualMachineSgxInfoFlcModes("locked") + VirtualMachineSgxInfoFlcModesUnlocked = VirtualMachineSgxInfoFlcModes("unlocked") +) + +func init() { + t["VirtualMachineSgxInfoFlcModes"] = reflect.TypeOf((*VirtualMachineSgxInfoFlcModes)(nil)).Elem() +} + type VirtualMachineStandbyActionType string const ( @@ -4383,11 +5013,12 @@ func init() { type VirtualMachineTicketType string const ( - VirtualMachineTicketTypeMks = VirtualMachineTicketType("mks") - VirtualMachineTicketTypeDevice = VirtualMachineTicketType("device") - VirtualMachineTicketTypeGuestControl = VirtualMachineTicketType("guestControl") - VirtualMachineTicketTypeWebmks = VirtualMachineTicketType("webmks") - VirtualMachineTicketTypeGuestIntegrity = VirtualMachineTicketType("guestIntegrity") + VirtualMachineTicketTypeMks = VirtualMachineTicketType("mks") + VirtualMachineTicketTypeDevice = VirtualMachineTicketType("device") + VirtualMachineTicketTypeGuestControl = VirtualMachineTicketType("guestControl") + VirtualMachineTicketTypeWebmks = VirtualMachineTicketType("webmks") + VirtualMachineTicketTypeGuestIntegrity = VirtualMachineTicketType("guestIntegrity") + VirtualMachineTicketTypeWebRemoteDevice = VirtualMachineTicketType("webRemoteDevice") ) func init() { @@ -4482,11 +5113,13 @@ func init() { type VirtualMachineUsbInfoSpeed string const ( - VirtualMachineUsbInfoSpeedLow = VirtualMachineUsbInfoSpeed("low") - VirtualMachineUsbInfoSpeedFull = VirtualMachineUsbInfoSpeed("full") - VirtualMachineUsbInfoSpeedHigh = VirtualMachineUsbInfoSpeed("high") - VirtualMachineUsbInfoSpeedSuperSpeed = VirtualMachineUsbInfoSpeed("superSpeed") - VirtualMachineUsbInfoSpeedUnknownSpeed = VirtualMachineUsbInfoSpeed("unknownSpeed") + VirtualMachineUsbInfoSpeedLow = VirtualMachineUsbInfoSpeed("low") + VirtualMachineUsbInfoSpeedFull = VirtualMachineUsbInfoSpeed("full") + VirtualMachineUsbInfoSpeedHigh = VirtualMachineUsbInfoSpeed("high") + VirtualMachineUsbInfoSpeedSuperSpeed = VirtualMachineUsbInfoSpeed("superSpeed") + VirtualMachineUsbInfoSpeedSuperSpeedPlus = VirtualMachineUsbInfoSpeed("superSpeedPlus") + VirtualMachineUsbInfoSpeedSuperSpeed20Gbps = VirtualMachineUsbInfoSpeed("superSpeed20Gbps") + VirtualMachineUsbInfoSpeedUnknownSpeed = VirtualMachineUsbInfoSpeed("unknownSpeed") ) func init() { @@ -4531,6 +5164,41 @@ func init() { t["VirtualMachineVMCIDeviceProtocol"] = reflect.TypeOf((*VirtualMachineVMCIDeviceProtocol)(nil)).Elem() } +type VirtualMachineVendorDeviceGroupInfoComponentDeviceInfoComponentType string + +const ( + VirtualMachineVendorDeviceGroupInfoComponentDeviceInfoComponentTypePciPassthru = VirtualMachineVendorDeviceGroupInfoComponentDeviceInfoComponentType("pciPassthru") + VirtualMachineVendorDeviceGroupInfoComponentDeviceInfoComponentTypeNvidiaVgpu = VirtualMachineVendorDeviceGroupInfoComponentDeviceInfoComponentType("nvidiaVgpu") + VirtualMachineVendorDeviceGroupInfoComponentDeviceInfoComponentTypeSriovNic = VirtualMachineVendorDeviceGroupInfoComponentDeviceInfoComponentType("sriovNic") + VirtualMachineVendorDeviceGroupInfoComponentDeviceInfoComponentTypeDvx = VirtualMachineVendorDeviceGroupInfoComponentDeviceInfoComponentType("dvx") +) + +func init() { + t["VirtualMachineVendorDeviceGroupInfoComponentDeviceInfoComponentType"] = reflect.TypeOf((*VirtualMachineVendorDeviceGroupInfoComponentDeviceInfoComponentType)(nil)).Elem() +} + +type VirtualMachineVgpuProfileInfoProfileClass string + +const ( + VirtualMachineVgpuProfileInfoProfileClassCompute = VirtualMachineVgpuProfileInfoProfileClass("compute") + VirtualMachineVgpuProfileInfoProfileClassQuadro = VirtualMachineVgpuProfileInfoProfileClass("quadro") +) + +func init() { + t["VirtualMachineVgpuProfileInfoProfileClass"] = reflect.TypeOf((*VirtualMachineVgpuProfileInfoProfileClass)(nil)).Elem() +} + +type VirtualMachineVgpuProfileInfoProfileSharing string + +const ( + VirtualMachineVgpuProfileInfoProfileSharingTimeSliced = VirtualMachineVgpuProfileInfoProfileSharing("timeSliced") + VirtualMachineVgpuProfileInfoProfileSharingMig = VirtualMachineVgpuProfileInfoProfileSharing("mig") +) + +func init() { + t["VirtualMachineVgpuProfileInfoProfileSharing"] = reflect.TypeOf((*VirtualMachineVgpuProfileInfoProfileSharing)(nil)).Elem() +} + type VirtualMachineVideoCardUse3dRenderer string const ( @@ -4543,6 +5211,31 @@ func init() { t["VirtualMachineVideoCardUse3dRenderer"] = reflect.TypeOf((*VirtualMachineVideoCardUse3dRenderer)(nil)).Elem() } +type VirtualMachineVirtualDeviceSwapDeviceSwapStatus string + +const ( + VirtualMachineVirtualDeviceSwapDeviceSwapStatusNone = VirtualMachineVirtualDeviceSwapDeviceSwapStatus("none") + VirtualMachineVirtualDeviceSwapDeviceSwapStatusScheduled = VirtualMachineVirtualDeviceSwapDeviceSwapStatus("scheduled") + VirtualMachineVirtualDeviceSwapDeviceSwapStatusInprogress = VirtualMachineVirtualDeviceSwapDeviceSwapStatus("inprogress") + VirtualMachineVirtualDeviceSwapDeviceSwapStatusFailed = VirtualMachineVirtualDeviceSwapDeviceSwapStatus("failed") + VirtualMachineVirtualDeviceSwapDeviceSwapStatusCompleted = VirtualMachineVirtualDeviceSwapDeviceSwapStatus("completed") +) + +func init() { + t["VirtualMachineVirtualDeviceSwapDeviceSwapStatus"] = reflect.TypeOf((*VirtualMachineVirtualDeviceSwapDeviceSwapStatus)(nil)).Elem() +} + +type VirtualMachineVirtualPMemSnapshotMode string + +const ( + VirtualMachineVirtualPMemSnapshotModeIndependent_persistent = VirtualMachineVirtualPMemSnapshotMode("independent_persistent") + VirtualMachineVirtualPMemSnapshotModeIndependent_eraseonrevert = VirtualMachineVirtualPMemSnapshotMode("independent_eraseonrevert") +) + +func init() { + t["VirtualMachineVirtualPMemSnapshotMode"] = reflect.TypeOf((*VirtualMachineVirtualPMemSnapshotMode)(nil)).Elem() +} + type VirtualMachineWindowsQuiesceSpecVssBackupContext string const ( @@ -4665,6 +5358,7 @@ const ( VmFaultToleranceConfigIssueReasonForIssueHasEFIFirmware = VmFaultToleranceConfigIssueReasonForIssue("hasEFIFirmware") VmFaultToleranceConfigIssueReasonForIssueTooManyVCPUs = VmFaultToleranceConfigIssueReasonForIssue("tooManyVCPUs") VmFaultToleranceConfigIssueReasonForIssueTooMuchMemory = VmFaultToleranceConfigIssueReasonForIssue("tooMuchMemory") + VmFaultToleranceConfigIssueReasonForIssueUnsupportedPMemHAFailOver = VmFaultToleranceConfigIssueReasonForIssue("unsupportedPMemHAFailOver") ) func init() { @@ -4811,6 +5505,35 @@ func init() { t["WillLoseHAProtectionResolution"] = reflect.TypeOf((*WillLoseHAProtectionResolution)(nil)).Elem() } +type VslmDiskInfoFlag string + +const ( + VslmDiskInfoFlagId = VslmDiskInfoFlag("id") + VslmDiskInfoFlagBackingObjectId = VslmDiskInfoFlag("backingObjectId") + VslmDiskInfoFlagPath = VslmDiskInfoFlag("path") + VslmDiskInfoFlagParentPath = VslmDiskInfoFlag("parentPath") + VslmDiskInfoFlagName = VslmDiskInfoFlag("name") + VslmDiskInfoFlagDeviceName = VslmDiskInfoFlag("deviceName") + VslmDiskInfoFlagCapacity = VslmDiskInfoFlag("capacity") + VslmDiskInfoFlagAllocated = VslmDiskInfoFlag("allocated") + VslmDiskInfoFlagType = VslmDiskInfoFlag("type") + VslmDiskInfoFlagConsumers = VslmDiskInfoFlag("consumers") + VslmDiskInfoFlagTentativeState = VslmDiskInfoFlag("tentativeState") + VslmDiskInfoFlagCreateTime = VslmDiskInfoFlag("createTime") + VslmDiskInfoFlagIoFilter = VslmDiskInfoFlag("ioFilter") + VslmDiskInfoFlagControlFlags = VslmDiskInfoFlag("controlFlags") + VslmDiskInfoFlagKeepAfterVmDelete = VslmDiskInfoFlag("keepAfterVmDelete") + VslmDiskInfoFlagRelocationDisabled = VslmDiskInfoFlag("relocationDisabled") + VslmDiskInfoFlagKeyId = VslmDiskInfoFlag("keyId") + VslmDiskInfoFlagKeyProviderId = VslmDiskInfoFlag("keyProviderId") + VslmDiskInfoFlagNativeSnapshotSupported = VslmDiskInfoFlag("nativeSnapshotSupported") + VslmDiskInfoFlagCbtEnabled = VslmDiskInfoFlag("cbtEnabled") +) + +func init() { + t["vslmDiskInfoFlag"] = reflect.TypeOf((*VslmDiskInfoFlag)(nil)).Elem() +} + type VslmVStorageObjectControlFlag string const ( diff --git a/vendor/github.com/vmware/govmomi/vim25/types/fault.go b/vendor/github.com/vmware/govmomi/vim25/types/fault.go index c2503fa5cb7..813ea9ec60e 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/fault.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/fault.go @@ -30,3 +30,14 @@ func IsFileNotFound(err error) bool { return false } + +func IsAlreadyExists(err error) bool { + if f, ok := err.(HasFault); ok { + switch f.Fault().(type) { + case *AlreadyExists: + return true + } + } + + return false +} diff --git a/vendor/github.com/vmware/govmomi/vim25/types/helpers.go b/vendor/github.com/vmware/govmomi/vim25/types/helpers.go index 95c49f333f3..70360eb4fca 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/helpers.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/helpers.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2015-2017 VMware, Inc. All Rights Reserved. +Copyright (c) 2015-2022 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ limitations under the License. package types import ( + "net/url" "reflect" "strings" "time" @@ -53,7 +54,7 @@ func (r ManagedObjectReference) String() string { func (r *ManagedObjectReference) FromString(o string) bool { s := strings.SplitN(o, ":", 2) - if len(s) < 2 { + if len(s) != 2 { return false } @@ -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) } @@ -88,6 +94,221 @@ func DefaultResourceConfigSpec() ResourceConfigSpec { } } +// ToConfigSpec returns a VirtualMachineConfigSpec based on the +// VirtualMachineConfigInfo. +func (ci VirtualMachineConfigInfo) ToConfigSpec() VirtualMachineConfigSpec { + cs := VirtualMachineConfigSpec{ + ChangeVersion: ci.ChangeVersion, + Name: ci.Name, + Version: ci.Version, + CreateDate: ci.CreateDate, + Uuid: ci.Uuid, + InstanceUuid: ci.InstanceUuid, + NpivNodeWorldWideName: ci.NpivNodeWorldWideName, + NpivPortWorldWideName: ci.NpivPortWorldWideName, + NpivWorldWideNameType: ci.NpivWorldWideNameType, + NpivDesiredNodeWwns: ci.NpivDesiredNodeWwns, + NpivDesiredPortWwns: ci.NpivDesiredPortWwns, + NpivTemporaryDisabled: ci.NpivTemporaryDisabled, + NpivOnNonRdmDisks: ci.NpivOnNonRdmDisks, + LocationId: ci.LocationId, + GuestId: ci.GuestId, + AlternateGuestName: ci.AlternateGuestName, + Annotation: ci.Annotation, + Files: &ci.Files, + Tools: ci.Tools, + Flags: &ci.Flags, + ConsolePreferences: ci.ConsolePreferences, + PowerOpInfo: &ci.DefaultPowerOps, + NumCPUs: ci.Hardware.NumCPU, + VcpuConfig: ci.VcpuConfig, + NumCoresPerSocket: ci.Hardware.NumCoresPerSocket, + MemoryMB: int64(ci.Hardware.MemoryMB), + MemoryHotAddEnabled: ci.MemoryHotAddEnabled, + CpuHotAddEnabled: ci.CpuHotAddEnabled, + CpuHotRemoveEnabled: ci.CpuHotRemoveEnabled, + VirtualICH7MPresent: ci.Hardware.VirtualICH7MPresent, + VirtualSMCPresent: ci.Hardware.VirtualSMCPresent, + DeviceChange: make([]BaseVirtualDeviceConfigSpec, len(ci.Hardware.Device)), + CpuAllocation: ci.CpuAllocation, + MemoryAllocation: ci.MemoryAllocation, + LatencySensitivity: ci.LatencySensitivity, + CpuAffinity: ci.CpuAffinity, + MemoryAffinity: ci.MemoryAffinity, + NetworkShaper: ci.NetworkShaper, + CpuFeatureMask: make([]VirtualMachineCpuIdInfoSpec, len(ci.CpuFeatureMask)), + ExtraConfig: ci.ExtraConfig, + SwapPlacement: ci.SwapPlacement, + BootOptions: ci.BootOptions, + FtInfo: ci.FtInfo, + RepConfig: ci.RepConfig, + VAssertsEnabled: ci.VAssertsEnabled, + ChangeTrackingEnabled: ci.ChangeTrackingEnabled, + Firmware: ci.Firmware, + MaxMksConnections: ci.MaxMksConnections, + GuestAutoLockEnabled: ci.GuestAutoLockEnabled, + ManagedBy: ci.ManagedBy, + MemoryReservationLockedToMax: ci.MemoryReservationLockedToMax, + NestedHVEnabled: ci.NestedHVEnabled, + VPMCEnabled: ci.VPMCEnabled, + MessageBusTunnelEnabled: ci.MessageBusTunnelEnabled, + MigrateEncryption: ci.MigrateEncryption, + FtEncryptionMode: ci.FtEncryptionMode, + SevEnabled: ci.SevEnabled, + PmemFailoverEnabled: ci.PmemFailoverEnabled, + Pmem: ci.Pmem, + NpivWorldWideNameOp: ci.NpivWorldWideNameType, + RebootPowerOff: ci.RebootPowerOff, + ScheduledHardwareUpgradeInfo: ci.ScheduledHardwareUpgradeInfo, + SgxInfo: ci.SgxInfo, + GuestMonitoringModeInfo: ci.GuestMonitoringModeInfo, + VmxStatsCollectionEnabled: ci.VmxStatsCollectionEnabled, + VmOpNotificationToAppEnabled: ci.VmOpNotificationToAppEnabled, + VmOpNotificationTimeout: ci.VmOpNotificationTimeout, + DeviceSwap: ci.DeviceSwap, + SimultaneousThreads: ci.Hardware.SimultaneousThreads, + DeviceGroups: ci.DeviceGroups, + MotherboardLayout: ci.Hardware.MotherboardLayout, + } + + // Unassign the Files field if all of its fields are empty. + if ci.Files.FtMetadataDirectory == "" && ci.Files.LogDirectory == "" && + ci.Files.SnapshotDirectory == "" && ci.Files.SuspendDirectory == "" && + ci.Files.VmPathName == "" { + cs.Files = nil + } + + // Unassign the Flags field if all of its fields are empty. + if ci.Flags.CbrcCacheEnabled == nil && + ci.Flags.DisableAcceleration == nil && + ci.Flags.DiskUuidEnabled == nil && + ci.Flags.EnableLogging == nil && + ci.Flags.FaultToleranceType == "" && + ci.Flags.HtSharing == "" && + ci.Flags.MonitorType == "" && + ci.Flags.RecordReplayEnabled == nil && + ci.Flags.RunWithDebugInfo == nil && + ci.Flags.SnapshotDisabled == nil && + ci.Flags.SnapshotLocked == nil && + ci.Flags.SnapshotPowerOffBehavior == "" && + ci.Flags.UseToe == nil && + ci.Flags.VbsEnabled == nil && + ci.Flags.VirtualExecUsage == "" && + ci.Flags.VirtualMmuUsage == "" && + ci.Flags.VvtdEnabled == nil { + cs.Flags = nil + } + + // Unassign the PowerOps field if all of its fields are empty. + if ci.DefaultPowerOps.DefaultPowerOffType == "" && + ci.DefaultPowerOps.DefaultResetType == "" && + ci.DefaultPowerOps.DefaultSuspendType == "" && + ci.DefaultPowerOps.PowerOffType == "" && + ci.DefaultPowerOps.ResetType == "" && + ci.DefaultPowerOps.StandbyAction == "" && + ci.DefaultPowerOps.SuspendType == "" { + cs.PowerOpInfo = nil + } + + for i := 0; i < len(cs.CpuFeatureMask); i++ { + cs.CpuFeatureMask[i] = VirtualMachineCpuIdInfoSpec{ + ArrayUpdateSpec: ArrayUpdateSpec{ + Operation: ArrayUpdateOperationAdd, + }, + Info: &HostCpuIdInfo{ + // TODO: Does DynamicData need to be copied? + // It is an empty struct... + Level: ci.CpuFeatureMask[i].Level, + Vendor: ci.CpuFeatureMask[i].Vendor, + Eax: ci.CpuFeatureMask[i].Eax, + Ebx: ci.CpuFeatureMask[i].Ebx, + Ecx: ci.CpuFeatureMask[i].Ecx, + Edx: ci.CpuFeatureMask[i].Edx, + }, + } + } + + for i := 0; i < len(cs.DeviceChange); i++ { + cs.DeviceChange[i] = &VirtualDeviceConfigSpec{ + // TODO: Does DynamicData need to be copied? + // It is an empty struct... + Operation: VirtualDeviceConfigSpecOperationAdd, + FileOperation: VirtualDeviceConfigSpecFileOperationCreate, + Device: ci.Hardware.Device[i], + // TODO: It is unclear how the profiles associated with the VM or + // its hardware can be reintroduced/persisted in the + // ConfigSpec. + Profile: nil, + // The backing will come from the device. + Backing: nil, + // TODO: Investigate futher. + FilterSpec: nil, + } + } + + if ni := ci.NumaInfo; ni != nil { + cs.VirtualNuma = &VirtualMachineVirtualNuma{ + CoresPerNumaNode: ni.CoresPerNumaNode, + ExposeVnumaOnCpuHotadd: ni.VnumaOnCpuHotaddExposed, + } + } + + if civa, ok := ci.VAppConfig.(*VmConfigInfo); ok { + var csva VmConfigSpec + + csva.Eula = civa.Eula + csva.InstallBootRequired = &civa.InstallBootRequired + csva.InstallBootStopDelay = civa.InstallBootStopDelay + + ipAssignment := civa.IpAssignment + csva.IpAssignment = &ipAssignment + + csva.OvfEnvironmentTransport = civa.OvfEnvironmentTransport + for i := range civa.OvfSection { + s := civa.OvfSection[i] + csva.OvfSection = append( + csva.OvfSection, + VAppOvfSectionSpec{ + ArrayUpdateSpec: ArrayUpdateSpec{ + Operation: ArrayUpdateOperationAdd, + }, + Info: &s, + }, + ) + } + + for i := range civa.Product { + p := civa.Product[i] + csva.Product = append( + csva.Product, + VAppProductSpec{ + ArrayUpdateSpec: ArrayUpdateSpec{ + Operation: ArrayUpdateOperationAdd, + }, + Info: &p, + }, + ) + } + + for i := range civa.Property { + p := civa.Property[i] + csva.Property = append( + csva.Property, + VAppPropertySpec{ + ArrayUpdateSpec: ArrayUpdateSpec{ + Operation: ArrayUpdateOperationAdd, + }, + Info: &p, + }, + ) + } + + cs.VAppConfig = &csva + } + + return cs +} + func init() { // Known 6.5 issue where this event type is sent even though it is internal. // This workaround allows us to unmarshal and avoid NPEs. diff --git a/vendor/github.com/vmware/govmomi/vim25/types/if.go b/vendor/github.com/vmware/govmomi/vim25/types/if.go index 7576198e639..03ba1f37d44 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/if.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/if.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2022 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -214,6 +214,18 @@ func init() { t["BaseClusterAction"] = reflect.TypeOf((*ClusterAction)(nil)).Elem() } +func (b *ClusterComputeResourceValidationResultBase) GetClusterComputeResourceValidationResultBase() *ClusterComputeResourceValidationResultBase { + return b +} + +type BaseClusterComputeResourceValidationResultBase interface { + GetClusterComputeResourceValidationResultBase() *ClusterComputeResourceValidationResultBase +} + +func init() { + t["BaseClusterComputeResourceValidationResultBase"] = reflect.TypeOf((*ClusterComputeResourceValidationResultBase)(nil)).Elem() +} + func (b *ClusterDasAdmissionControlInfo) GetClusterDasAdmissionControlInfo() *ClusterDasAdmissionControlInfo { return b } @@ -786,7 +798,6 @@ func (b *DvsFilterConfig) GetDvsFilterConfig() *DvsFilterConfig { return b } type BaseDvsFilterConfig interface { GetDvsFilterConfig() *DvsFilterConfig - GetDvsTrafficFilterConfig() *DvsTrafficFilterConfig } func init() { @@ -829,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 { @@ -1254,6 +1256,18 @@ func init() { t["BaseHostDasEvent"] = reflect.TypeOf((*HostDasEvent)(nil)).Elem() } +func (b *HostDataTransportConnectionInfo) GetHostDataTransportConnectionInfo() *HostDataTransportConnectionInfo { + return b +} + +type BaseHostDataTransportConnectionInfo interface { + GetHostDataTransportConnectionInfo() *HostDataTransportConnectionInfo +} + +func init() { + t["BaseHostDataTransportConnectionInfo"] = reflect.TypeOf((*HostDataTransportConnectionInfo)(nil)).Elem() +} + func (b *HostDatastoreConnectInfo) GetHostDatastoreConnectInfo() *HostDatastoreConnectInfo { return b } type BaseHostDatastoreConnectInfo interface { @@ -1356,6 +1370,16 @@ func init() { t["BaseHostHardwareElementInfo"] = reflect.TypeOf((*HostHardwareElementInfo)(nil)).Elem() } +func (b *HostHbaCreateSpec) GetHostHbaCreateSpec() *HostHbaCreateSpec { return b } + +type BaseHostHbaCreateSpec interface { + GetHostHbaCreateSpec() *HostHbaCreateSpec +} + +func init() { + t["BaseHostHbaCreateSpec"] = reflect.TypeOf((*HostHbaCreateSpec)(nil)).Elem() +} + func (b *HostHostBusAdapter) GetHostHostBusAdapter() *HostHostBusAdapter { return b } type BaseHostHostBusAdapter interface { @@ -1412,6 +1436,28 @@ func init() { t["BaseHostMultipathInfoLogicalUnitPolicy"] = reflect.TypeOf((*HostMultipathInfoLogicalUnitPolicy)(nil)).Elem() } +func (b *HostNvmeSpec) GetHostNvmeSpec() *HostNvmeSpec { return b } + +type BaseHostNvmeSpec interface { + GetHostNvmeSpec() *HostNvmeSpec +} + +func init() { + t["BaseHostNvmeSpec"] = reflect.TypeOf((*HostNvmeSpec)(nil)).Elem() +} + +func (b *HostNvmeTransportParameters) GetHostNvmeTransportParameters() *HostNvmeTransportParameters { + return b +} + +type BaseHostNvmeTransportParameters interface { + GetHostNvmeTransportParameters() *HostNvmeTransportParameters +} + +func init() { + t["BaseHostNvmeTransportParameters"] = reflect.TypeOf((*HostNvmeTransportParameters)(nil)).Elem() +} + func (b *HostPciPassthruConfig) GetHostPciPassthruConfig() *HostPciPassthruConfig { return b } type BaseHostPciPassthruConfig interface { @@ -1464,6 +1510,16 @@ func init() { t["BaseHostProfilesEntityCustomizations"] = reflect.TypeOf((*HostProfilesEntityCustomizations)(nil)).Elem() } +func (b *HostRdmaDeviceBacking) GetHostRdmaDeviceBacking() *HostRdmaDeviceBacking { return b } + +type BaseHostRdmaDeviceBacking interface { + GetHostRdmaDeviceBacking() *HostRdmaDeviceBacking +} + +func init() { + t["BaseHostRdmaDeviceBacking"] = reflect.TypeOf((*HostRdmaDeviceBacking)(nil)).Elem() +} + func (b *HostSriovDevicePoolInfo) GetHostSriovDevicePoolInfo() *HostSriovDevicePoolInfo { return b } type BaseHostSriovDevicePoolInfo interface { @@ -1496,6 +1552,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 { @@ -2966,6 +3034,18 @@ func init() { t["BaseVirtualHardwareCompatibilityIssue"] = reflect.TypeOf((*VirtualHardwareCompatibilityIssue)(nil)).Elem() } +func (b *VirtualMachineBaseIndependentFilterSpec) GetVirtualMachineBaseIndependentFilterSpec() *VirtualMachineBaseIndependentFilterSpec { + return b +} + +type BaseVirtualMachineBaseIndependentFilterSpec interface { + GetVirtualMachineBaseIndependentFilterSpec() *VirtualMachineBaseIndependentFilterSpec +} + +func init() { + t["BaseVirtualMachineBaseIndependentFilterSpec"] = reflect.TypeOf((*VirtualMachineBaseIndependentFilterSpec)(nil)).Elem() +} + func (b *VirtualMachineBootOptionsBootableDevice) GetVirtualMachineBootOptionsBootableDevice() *VirtualMachineBootOptionsBootableDevice { return b } @@ -2978,6 +3058,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 } @@ -3060,6 +3150,18 @@ func init() { t["BaseVirtualMachineTargetInfo"] = reflect.TypeOf((*VirtualMachineTargetInfo)(nil)).Elem() } +func (b *VirtualMachineVirtualDeviceGroupsDeviceGroup) GetVirtualMachineVirtualDeviceGroupsDeviceGroup() *VirtualMachineVirtualDeviceGroupsDeviceGroup { + return b +} + +type BaseVirtualMachineVirtualDeviceGroupsDeviceGroup interface { + GetVirtualMachineVirtualDeviceGroupsDeviceGroup() *VirtualMachineVirtualDeviceGroupsDeviceGroup +} + +func init() { + t["BaseVirtualMachineVirtualDeviceGroupsDeviceGroup"] = reflect.TypeOf((*VirtualMachineVirtualDeviceGroupsDeviceGroup)(nil)).Elem() +} + func (b *VirtualPCIPassthroughPluginBackingInfo) GetVirtualPCIPassthroughPluginBackingInfo() *VirtualPCIPassthroughPluginBackingInfo { return b } diff --git a/vendor/github.com/vmware/govmomi/vim25/types/types.go b/vendor/github.com/vmware/govmomi/vim25/types/types.go index e990e273e22..f7ae195f79f 100644 --- a/vendor/github.com/vmware/govmomi/vim25/types/types.go +++ b/vendor/github.com/vmware/govmomi/vim25/types/types.go @@ -1,5 +1,5 @@ /* -Copyright (c) 2014-2018 VMware, Inc. All Rights Reserved. +Copyright (c) 2014-2022 VMware, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,6 +21,23 @@ import ( "time" ) +type AbandonHciWorkflow AbandonHciWorkflowRequestType + +func init() { + t["AbandonHciWorkflow"] = reflect.TypeOf((*AbandonHciWorkflow)(nil)).Elem() +} + +type AbandonHciWorkflowRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["AbandonHciWorkflowRequestType"] = reflect.TypeOf((*AbandonHciWorkflowRequestType)(nil)).Elem() +} + +type AbandonHciWorkflowResponse struct { +} + type AbdicateDomOwnership AbdicateDomOwnershipRequestType func init() { @@ -40,6 +57,26 @@ type AbdicateDomOwnershipResponse struct { Returnval []string `xml:"returnval,omitempty"` } +type AbortCustomizationRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` +} + +func init() { + t["AbortCustomizationRequestType"] = reflect.TypeOf((*AbortCustomizationRequestType)(nil)).Elem() +} + +type AbortCustomization_Task AbortCustomizationRequestType + +func init() { + t["AbortCustomization_Task"] = reflect.TypeOf((*AbortCustomization_Task)(nil)).Elem() +} + +type AbortCustomization_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + type AboutInfo struct { DynamicData @@ -47,6 +84,7 @@ type AboutInfo struct { FullName string `xml:"fullName"` Vendor string `xml:"vendor"` Version string `xml:"version"` + PatchLevel string `xml:"patchLevel,omitempty"` Build string `xml:"build"` LocaleVersion string `xml:"localeVersion,omitempty"` LocaleBuild string `xml:"localeBuild,omitempty"` @@ -1028,6 +1066,7 @@ type AlarmState struct { AcknowledgedByUser string `xml:"acknowledgedByUser,omitempty"` AcknowledgedTime *time.Time `xml:"acknowledgedTime"` EventKey int32 `xml:"eventKey,omitempty"` + Disabled *bool `xml:"disabled"` } func init() { @@ -1709,6 +1748,70 @@ func init() { t["ArrayOfClusterAttemptedVmInfo"] = reflect.TypeOf((*ArrayOfClusterAttemptedVmInfo)(nil)).Elem() } +type ArrayOfClusterComputeResourceDVSSetting struct { + ClusterComputeResourceDVSSetting []ClusterComputeResourceDVSSetting `xml:"ClusterComputeResourceDVSSetting,omitempty"` +} + +func init() { + t["ArrayOfClusterComputeResourceDVSSetting"] = reflect.TypeOf((*ArrayOfClusterComputeResourceDVSSetting)(nil)).Elem() +} + +type ArrayOfClusterComputeResourceDVSSettingDVPortgroupToServiceMapping struct { + ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping []ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping `xml:"ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping,omitempty"` +} + +func init() { + t["ArrayOfClusterComputeResourceDVSSettingDVPortgroupToServiceMapping"] = reflect.TypeOf((*ArrayOfClusterComputeResourceDVSSettingDVPortgroupToServiceMapping)(nil)).Elem() +} + +type ArrayOfClusterComputeResourceDvsProfile struct { + ClusterComputeResourceDvsProfile []ClusterComputeResourceDvsProfile `xml:"ClusterComputeResourceDvsProfile,omitempty"` +} + +func init() { + t["ArrayOfClusterComputeResourceDvsProfile"] = reflect.TypeOf((*ArrayOfClusterComputeResourceDvsProfile)(nil)).Elem() +} + +type ArrayOfClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping struct { + ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping []ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping `xml:"ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping,omitempty"` +} + +func init() { + t["ArrayOfClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping"] = reflect.TypeOf((*ArrayOfClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping)(nil)).Elem() +} + +type ArrayOfClusterComputeResourceHostConfigurationInput struct { + ClusterComputeResourceHostConfigurationInput []ClusterComputeResourceHostConfigurationInput `xml:"ClusterComputeResourceHostConfigurationInput,omitempty"` +} + +func init() { + t["ArrayOfClusterComputeResourceHostConfigurationInput"] = reflect.TypeOf((*ArrayOfClusterComputeResourceHostConfigurationInput)(nil)).Elem() +} + +type ArrayOfClusterComputeResourceHostVmkNicInfo struct { + ClusterComputeResourceHostVmkNicInfo []ClusterComputeResourceHostVmkNicInfo `xml:"ClusterComputeResourceHostVmkNicInfo,omitempty"` +} + +func init() { + t["ArrayOfClusterComputeResourceHostVmkNicInfo"] = reflect.TypeOf((*ArrayOfClusterComputeResourceHostVmkNicInfo)(nil)).Elem() +} + +type ArrayOfClusterComputeResourceValidationResultBase struct { + ClusterComputeResourceValidationResultBase []BaseClusterComputeResourceValidationResultBase `xml:"ClusterComputeResourceValidationResultBase,omitempty,typeattr"` +} + +func init() { + t["ArrayOfClusterComputeResourceValidationResultBase"] = reflect.TypeOf((*ArrayOfClusterComputeResourceValidationResultBase)(nil)).Elem() +} + +type ArrayOfClusterComputeResourceVcsSlots struct { + ClusterComputeResourceVcsSlots []ClusterComputeResourceVcsSlots `xml:"ClusterComputeResourceVcsSlots,omitempty"` +} + +func init() { + t["ArrayOfClusterComputeResourceVcsSlots"] = reflect.TypeOf((*ArrayOfClusterComputeResourceVcsSlots)(nil)).Elem() +} + type ArrayOfClusterDasAamNodeState struct { ClusterDasAamNodeState []ClusterDasAamNodeState `xml:"ClusterDasAamNodeState,omitempty"` } @@ -1749,6 +1852,14 @@ func init() { t["ArrayOfClusterDasVmConfigSpec"] = reflect.TypeOf((*ArrayOfClusterDasVmConfigSpec)(nil)).Elem() } +type ArrayOfClusterDatastoreUpdateSpec struct { + ClusterDatastoreUpdateSpec []ClusterDatastoreUpdateSpec `xml:"ClusterDatastoreUpdateSpec,omitempty"` +} + +func init() { + t["ArrayOfClusterDatastoreUpdateSpec"] = reflect.TypeOf((*ArrayOfClusterDatastoreUpdateSpec)(nil)).Elem() +} + type ArrayOfClusterDpmHostConfigInfo struct { ClusterDpmHostConfigInfo []ClusterDpmHostConfigInfo `xml:"ClusterDpmHostConfigInfo,omitempty"` } @@ -1893,6 +2004,14 @@ func init() { t["ArrayOfClusterRuleSpec"] = reflect.TypeOf((*ArrayOfClusterRuleSpec)(nil)).Elem() } +type ArrayOfClusterTagCategoryUpdateSpec struct { + ClusterTagCategoryUpdateSpec []ClusterTagCategoryUpdateSpec `xml:"ClusterTagCategoryUpdateSpec,omitempty"` +} + +func init() { + t["ArrayOfClusterTagCategoryUpdateSpec"] = reflect.TypeOf((*ArrayOfClusterTagCategoryUpdateSpec)(nil)).Elem() +} + type ArrayOfClusterVmOrchestrationInfo struct { ClusterVmOrchestrationInfo []ClusterVmOrchestrationInfo `xml:"ClusterVmOrchestrationInfo,omitempty"` } @@ -1989,6 +2108,14 @@ func init() { t["ArrayOfCryptoManagerKmipClusterStatus"] = reflect.TypeOf((*ArrayOfCryptoManagerKmipClusterStatus)(nil)).Elem() } +type ArrayOfCryptoManagerKmipCryptoKeyStatus struct { + CryptoManagerKmipCryptoKeyStatus []CryptoManagerKmipCryptoKeyStatus `xml:"CryptoManagerKmipCryptoKeyStatus,omitempty"` +} + +func init() { + t["ArrayOfCryptoManagerKmipCryptoKeyStatus"] = reflect.TypeOf((*ArrayOfCryptoManagerKmipCryptoKeyStatus)(nil)).Elem() +} + type ArrayOfCryptoManagerKmipServerStatus struct { CryptoManagerKmipServerStatus []CryptoManagerKmipServerStatus `xml:"CryptoManagerKmipServerStatus,omitempty"` } @@ -2061,6 +2188,14 @@ func init() { t["ArrayOfDVSHealthCheckConfig"] = reflect.TypeOf((*ArrayOfDVSHealthCheckConfig)(nil)).Elem() } +type ArrayOfDVSManagerPhysicalNicsList struct { + DVSManagerPhysicalNicsList []DVSManagerPhysicalNicsList `xml:"DVSManagerPhysicalNicsList,omitempty"` +} + +func init() { + t["ArrayOfDVSManagerPhysicalNicsList"] = reflect.TypeOf((*ArrayOfDVSManagerPhysicalNicsList)(nil)).Elem() +} + type ArrayOfDVSNetworkResourcePool struct { DVSNetworkResourcePool []DVSNetworkResourcePool `xml:"DVSNetworkResourcePool,omitempty"` } @@ -2093,6 +2228,14 @@ func init() { t["ArrayOfDasHeartbeatDatastoreInfo"] = reflect.TypeOf((*ArrayOfDasHeartbeatDatastoreInfo)(nil)).Elem() } +type ArrayOfDatacenterBasicConnectInfo struct { + DatacenterBasicConnectInfo []DatacenterBasicConnectInfo `xml:"DatacenterBasicConnectInfo,omitempty"` +} + +func init() { + t["ArrayOfDatacenterBasicConnectInfo"] = reflect.TypeOf((*ArrayOfDatacenterBasicConnectInfo)(nil)).Elem() +} + type ArrayOfDatacenterMismatchArgument struct { DatacenterMismatchArgument []DatacenterMismatchArgument `xml:"DatacenterMismatchArgument,omitempty"` } @@ -2125,6 +2268,14 @@ func init() { t["ArrayOfDatastoreVVolContainerFailoverPair"] = reflect.TypeOf((*ArrayOfDatastoreVVolContainerFailoverPair)(nil)).Elem() } +type ArrayOfDesiredSoftwareSpecComponentSpec struct { + DesiredSoftwareSpecComponentSpec []DesiredSoftwareSpecComponentSpec `xml:"DesiredSoftwareSpecComponentSpec,omitempty"` +} + +func init() { + t["ArrayOfDesiredSoftwareSpecComponentSpec"] = reflect.TypeOf((*ArrayOfDesiredSoftwareSpecComponentSpec)(nil)).Elem() +} + type ArrayOfDiagnosticManagerBundleInfo struct { DiagnosticManagerBundleInfo []DiagnosticManagerBundleInfo `xml:"DiagnosticManagerBundleInfo,omitempty"` } @@ -2165,6 +2316,14 @@ func init() { t["ArrayOfDistributedVirtualPortgroupInfo"] = reflect.TypeOf((*ArrayOfDistributedVirtualPortgroupInfo)(nil)).Elem() } +type ArrayOfDistributedVirtualPortgroupProblem struct { + DistributedVirtualPortgroupProblem []DistributedVirtualPortgroupProblem `xml:"DistributedVirtualPortgroupProblem,omitempty"` +} + +func init() { + t["ArrayOfDistributedVirtualPortgroupProblem"] = reflect.TypeOf((*ArrayOfDistributedVirtualPortgroupProblem)(nil)).Elem() +} + type ArrayOfDistributedVirtualSwitchHostMember struct { DistributedVirtualSwitchHostMember []DistributedVirtualSwitchHostMember `xml:"DistributedVirtualSwitchHostMember,omitempty"` } @@ -2189,6 +2348,14 @@ func init() { t["ArrayOfDistributedVirtualSwitchHostMemberPnicSpec"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchHostMemberPnicSpec)(nil)).Elem() } +type ArrayOfDistributedVirtualSwitchHostMemberTransportZoneInfo struct { + DistributedVirtualSwitchHostMemberTransportZoneInfo []DistributedVirtualSwitchHostMemberTransportZoneInfo `xml:"DistributedVirtualSwitchHostMemberTransportZoneInfo,omitempty"` +} + +func init() { + t["ArrayOfDistributedVirtualSwitchHostMemberTransportZoneInfo"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchHostMemberTransportZoneInfo)(nil)).Elem() +} + type ArrayOfDistributedVirtualSwitchHostProductSpec struct { DistributedVirtualSwitchHostProductSpec []DistributedVirtualSwitchHostProductSpec `xml:"DistributedVirtualSwitchHostProductSpec,omitempty"` } @@ -2229,6 +2396,14 @@ func init() { t["ArrayOfDistributedVirtualSwitchManagerHostDvsFilterSpec"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchManagerHostDvsFilterSpec)(nil)).Elem() } +type ArrayOfDistributedVirtualSwitchNetworkOffloadSpec struct { + DistributedVirtualSwitchNetworkOffloadSpec []DistributedVirtualSwitchNetworkOffloadSpec `xml:"DistributedVirtualSwitchNetworkOffloadSpec,omitempty"` +} + +func init() { + t["ArrayOfDistributedVirtualSwitchNetworkOffloadSpec"] = reflect.TypeOf((*ArrayOfDistributedVirtualSwitchNetworkOffloadSpec)(nil)).Elem() +} + type ArrayOfDistributedVirtualSwitchProductSpec struct { DistributedVirtualSwitchProductSpec []DistributedVirtualSwitchProductSpec `xml:"DistributedVirtualSwitchProductSpec,omitempty"` } @@ -2245,6 +2420,22 @@ func init() { t["ArrayOfDouble"] = reflect.TypeOf((*ArrayOfDouble)(nil)).Elem() } +type ArrayOfDpuStatusInfo struct { + DpuStatusInfo []DpuStatusInfo `xml:"DpuStatusInfo,omitempty"` +} + +func init() { + t["ArrayOfDpuStatusInfo"] = reflect.TypeOf((*ArrayOfDpuStatusInfo)(nil)).Elem() +} + +type ArrayOfDpuStatusInfoOperationalInfo struct { + DpuStatusInfoOperationalInfo []DpuStatusInfoOperationalInfo `xml:"DpuStatusInfoOperationalInfo,omitempty"` +} + +func init() { + t["ArrayOfDpuStatusInfoOperationalInfo"] = reflect.TypeOf((*ArrayOfDpuStatusInfoOperationalInfo)(nil)).Elem() +} + type ArrayOfDvsApplyOperationFaultFaultOnObject struct { DvsApplyOperationFaultFaultOnObject []DvsApplyOperationFaultFaultOnObject `xml:"DvsApplyOperationFaultFaultOnObject,omitempty"` } @@ -2557,6 +2748,14 @@ func init() { t["ArrayOfFcoeConfigVlanRange"] = reflect.TypeOf((*ArrayOfFcoeConfigVlanRange)(nil)).Elem() } +type ArrayOfFeatureEVCMode struct { + FeatureEVCMode []FeatureEVCMode `xml:"FeatureEVCMode,omitempty"` +} + +func init() { + t["ArrayOfFeatureEVCMode"] = reflect.TypeOf((*ArrayOfFeatureEVCMode)(nil)).Elem() +} + type ArrayOfFileInfo struct { FileInfo []BaseFileInfo `xml:"FileInfo,omitempty,typeattr"` } @@ -2581,6 +2780,22 @@ func init() { t["ArrayOfFirewallProfileRulesetProfile"] = reflect.TypeOf((*ArrayOfFirewallProfileRulesetProfile)(nil)).Elem() } +type ArrayOfFolderFailedHostResult struct { + FolderFailedHostResult []FolderFailedHostResult `xml:"FolderFailedHostResult,omitempty"` +} + +func init() { + t["ArrayOfFolderFailedHostResult"] = reflect.TypeOf((*ArrayOfFolderFailedHostResult)(nil)).Elem() +} + +type ArrayOfFolderNewHostSpec struct { + FolderNewHostSpec []FolderNewHostSpec `xml:"FolderNewHostSpec,omitempty"` +} + +func init() { + t["ArrayOfFolderNewHostSpec"] = reflect.TypeOf((*ArrayOfFolderNewHostSpec)(nil)).Elem() +} + type ArrayOfGuestAliases struct { GuestAliases []GuestAliases `xml:"GuestAliases,omitempty"` } @@ -2629,6 +2844,14 @@ func init() { t["ArrayOfGuestInfoNamespaceGenerationInfo"] = reflect.TypeOf((*ArrayOfGuestInfoNamespaceGenerationInfo)(nil)).Elem() } +type ArrayOfGuestInfoVirtualDiskMapping struct { + GuestInfoVirtualDiskMapping []GuestInfoVirtualDiskMapping `xml:"GuestInfoVirtualDiskMapping,omitempty"` +} + +func init() { + t["ArrayOfGuestInfoVirtualDiskMapping"] = reflect.TypeOf((*ArrayOfGuestInfoVirtualDiskMapping)(nil)).Elem() +} + type ArrayOfGuestMappedAliases struct { GuestMappedAliases []GuestMappedAliases `xml:"GuestMappedAliases,omitempty"` } @@ -2733,6 +2956,22 @@ func init() { t["ArrayOfHostActiveDirectory"] = reflect.TypeOf((*ArrayOfHostActiveDirectory)(nil)).Elem() } +type ArrayOfHostAssignableHardwareBinding struct { + HostAssignableHardwareBinding []HostAssignableHardwareBinding `xml:"HostAssignableHardwareBinding,omitempty"` +} + +func init() { + t["ArrayOfHostAssignableHardwareBinding"] = reflect.TypeOf((*ArrayOfHostAssignableHardwareBinding)(nil)).Elem() +} + +type ArrayOfHostAssignableHardwareConfigAttributeOverride struct { + HostAssignableHardwareConfigAttributeOverride []HostAssignableHardwareConfigAttributeOverride `xml:"HostAssignableHardwareConfigAttributeOverride,omitempty"` +} + +func init() { + t["ArrayOfHostAssignableHardwareConfigAttributeOverride"] = reflect.TypeOf((*ArrayOfHostAssignableHardwareConfigAttributeOverride)(nil)).Elem() +} + type ArrayOfHostAuthenticationStoreInfo struct { HostAuthenticationStoreInfo []BaseHostAuthenticationStoreInfo `xml:"HostAuthenticationStoreInfo,omitempty,typeattr"` } @@ -2765,6 +3004,14 @@ func init() { t["ArrayOfHostConnectInfoNetworkInfo"] = reflect.TypeOf((*ArrayOfHostConnectInfoNetworkInfo)(nil)).Elem() } +type ArrayOfHostConnectSpec struct { + HostConnectSpec []HostConnectSpec `xml:"HostConnectSpec,omitempty"` +} + +func init() { + t["ArrayOfHostConnectSpec"] = reflect.TypeOf((*ArrayOfHostConnectSpec)(nil)).Elem() +} + type ArrayOfHostCpuIdInfo struct { HostCpuIdInfo []HostCpuIdInfo `xml:"HostCpuIdInfo,omitempty"` } @@ -2885,6 +3132,14 @@ func init() { t["ArrayOfHostDiskPartitionInfo"] = reflect.TypeOf((*ArrayOfHostDiskPartitionInfo)(nil)).Elem() } +type ArrayOfHostDvxClass struct { + HostDvxClass []HostDvxClass `xml:"HostDvxClass,omitempty"` +} + +func init() { + t["ArrayOfHostDvxClass"] = reflect.TypeOf((*ArrayOfHostDvxClass)(nil)).Elem() +} + type ArrayOfHostEventArgument struct { HostEventArgument []HostEventArgument `xml:"HostEventArgument,omitempty"` } @@ -3117,6 +3372,14 @@ func init() { t["ArrayOfHostMemberRuntimeInfo"] = reflect.TypeOf((*ArrayOfHostMemberRuntimeInfo)(nil)).Elem() } +type ArrayOfHostMemoryTierInfo struct { + HostMemoryTierInfo []HostMemoryTierInfo `xml:"HostMemoryTierInfo,omitempty"` +} + +func init() { + t["ArrayOfHostMemoryTierInfo"] = reflect.TypeOf((*ArrayOfHostMemoryTierInfo)(nil)).Elem() +} + type ArrayOfHostMultipathInfoLogicalUnit struct { HostMultipathInfoLogicalUnit []HostMultipathInfoLogicalUnit `xml:"HostMultipathInfoLogicalUnit,omitempty"` } @@ -3205,6 +3468,54 @@ func init() { t["ArrayOfHostNumericSensorInfo"] = reflect.TypeOf((*ArrayOfHostNumericSensorInfo)(nil)).Elem() } +type ArrayOfHostNvmeConnectSpec struct { + HostNvmeConnectSpec []HostNvmeConnectSpec `xml:"HostNvmeConnectSpec,omitempty"` +} + +func init() { + t["ArrayOfHostNvmeConnectSpec"] = reflect.TypeOf((*ArrayOfHostNvmeConnectSpec)(nil)).Elem() +} + +type ArrayOfHostNvmeController struct { + HostNvmeController []HostNvmeController `xml:"HostNvmeController,omitempty"` +} + +func init() { + t["ArrayOfHostNvmeController"] = reflect.TypeOf((*ArrayOfHostNvmeController)(nil)).Elem() +} + +type ArrayOfHostNvmeDisconnectSpec struct { + HostNvmeDisconnectSpec []HostNvmeDisconnectSpec `xml:"HostNvmeDisconnectSpec,omitempty"` +} + +func init() { + t["ArrayOfHostNvmeDisconnectSpec"] = reflect.TypeOf((*ArrayOfHostNvmeDisconnectSpec)(nil)).Elem() +} + +type ArrayOfHostNvmeDiscoveryLogEntry struct { + HostNvmeDiscoveryLogEntry []HostNvmeDiscoveryLogEntry `xml:"HostNvmeDiscoveryLogEntry,omitempty"` +} + +func init() { + t["ArrayOfHostNvmeDiscoveryLogEntry"] = reflect.TypeOf((*ArrayOfHostNvmeDiscoveryLogEntry)(nil)).Elem() +} + +type ArrayOfHostNvmeNamespace struct { + HostNvmeNamespace []HostNvmeNamespace `xml:"HostNvmeNamespace,omitempty"` +} + +func init() { + t["ArrayOfHostNvmeNamespace"] = reflect.TypeOf((*ArrayOfHostNvmeNamespace)(nil)).Elem() +} + +type ArrayOfHostNvmeTopologyInterface struct { + HostNvmeTopologyInterface []HostNvmeTopologyInterface `xml:"HostNvmeTopologyInterface,omitempty"` +} + +func init() { + t["ArrayOfHostNvmeTopologyInterface"] = reflect.TypeOf((*ArrayOfHostNvmeTopologyInterface)(nil)).Elem() +} + type ArrayOfHostOpaqueNetworkInfo struct { HostOpaqueNetworkInfo []HostOpaqueNetworkInfo `xml:"HostOpaqueNetworkInfo,omitempty"` } @@ -3437,6 +3748,30 @@ func init() { t["ArrayOfHostProxySwitchHostLagConfig"] = reflect.TypeOf((*ArrayOfHostProxySwitchHostLagConfig)(nil)).Elem() } +type ArrayOfHostPtpConfigPtpPort struct { + HostPtpConfigPtpPort []HostPtpConfigPtpPort `xml:"HostPtpConfigPtpPort,omitempty"` +} + +func init() { + t["ArrayOfHostPtpConfigPtpPort"] = reflect.TypeOf((*ArrayOfHostPtpConfigPtpPort)(nil)).Elem() +} + +type ArrayOfHostQualifiedName struct { + HostQualifiedName []HostQualifiedName `xml:"HostQualifiedName,omitempty"` +} + +func init() { + t["ArrayOfHostQualifiedName"] = reflect.TypeOf((*ArrayOfHostQualifiedName)(nil)).Elem() +} + +type ArrayOfHostRdmaDevice struct { + HostRdmaDevice []HostRdmaDevice `xml:"HostRdmaDevice,omitempty"` +} + +func init() { + t["ArrayOfHostRdmaDevice"] = reflect.TypeOf((*ArrayOfHostRdmaDevice)(nil)).Elem() +} + type ArrayOfHostRuntimeInfoNetStackInstanceRuntimeInfo struct { HostRuntimeInfoNetStackInstanceRuntimeInfo []HostRuntimeInfoNetStackInstanceRuntimeInfo `xml:"HostRuntimeInfoNetStackInstanceRuntimeInfo,omitempty"` } @@ -3629,6 +3964,14 @@ func init() { t["ArrayOfHostTpmEventLogEntry"] = reflect.TypeOf((*ArrayOfHostTpmEventLogEntry)(nil)).Elem() } +type ArrayOfHostTrustAuthorityAttestationInfo struct { + HostTrustAuthorityAttestationInfo []HostTrustAuthorityAttestationInfo `xml:"HostTrustAuthorityAttestationInfo,omitempty"` +} + +func init() { + t["ArrayOfHostTrustAuthorityAttestationInfo"] = reflect.TypeOf((*ArrayOfHostTrustAuthorityAttestationInfo)(nil)).Elem() +} + type ArrayOfHostUnresolvedVmfsExtent struct { HostUnresolvedVmfsExtent []HostUnresolvedVmfsExtent `xml:"HostUnresolvedVmfsExtent,omitempty"` } @@ -3797,6 +4140,14 @@ func init() { t["ArrayOfHttpNfcLeaseManifestEntry"] = reflect.TypeOf((*ArrayOfHttpNfcLeaseManifestEntry)(nil)).Elem() } +type ArrayOfHttpNfcLeaseProbeResult struct { + HttpNfcLeaseProbeResult []HttpNfcLeaseProbeResult `xml:"HttpNfcLeaseProbeResult,omitempty"` +} + +func init() { + t["ArrayOfHttpNfcLeaseProbeResult"] = reflect.TypeOf((*ArrayOfHttpNfcLeaseProbeResult)(nil)).Elem() +} + type ArrayOfHttpNfcLeaseSourceFile struct { HttpNfcLeaseSourceFile []HttpNfcLeaseSourceFile `xml:"HttpNfcLeaseSourceFile,omitempty"` } @@ -4109,6 +4460,14 @@ func init() { t["ArrayOfNetStackInstanceProfile"] = reflect.TypeOf((*ArrayOfNetStackInstanceProfile)(nil)).Elem() } +type ArrayOfNoPermissionEntityPrivileges struct { + NoPermissionEntityPrivileges []NoPermissionEntityPrivileges `xml:"NoPermissionEntityPrivileges,omitempty"` +} + +func init() { + t["ArrayOfNoPermissionEntityPrivileges"] = reflect.TypeOf((*ArrayOfNoPermissionEntityPrivileges)(nil)).Elem() +} + type ArrayOfNsxHostVNicProfile struct { NsxHostVNicProfile []NsxHostVNicProfile `xml:"NsxHostVNicProfile,omitempty"` } @@ -4149,6 +4508,14 @@ func init() { t["ArrayOfNvdimmInterleaveSetInfo"] = reflect.TypeOf((*ArrayOfNvdimmInterleaveSetInfo)(nil)).Elem() } +type ArrayOfNvdimmNamespaceDetails struct { + NvdimmNamespaceDetails []NvdimmNamespaceDetails `xml:"NvdimmNamespaceDetails,omitempty"` +} + +func init() { + t["ArrayOfNvdimmNamespaceDetails"] = reflect.TypeOf((*ArrayOfNvdimmNamespaceDetails)(nil)).Elem() +} + type ArrayOfNvdimmNamespaceInfo struct { NvdimmNamespaceInfo []NvdimmNamespaceInfo `xml:"NvdimmNamespaceInfo,omitempty"` } @@ -4909,6 +5276,14 @@ func init() { t["ArrayOfUpdateVirtualMachineFilesResultFailedVmFileInfo"] = reflect.TypeOf((*ArrayOfUpdateVirtualMachineFilesResultFailedVmFileInfo)(nil)).Elem() } +type ArrayOfUri struct { + Uri []string `xml:"uri,omitempty"` +} + +func init() { + t["ArrayOfUri"] = reflect.TypeOf((*ArrayOfUri)(nil)).Elem() +} + type ArrayOfUsbScanCodeSpecKeyEvent struct { UsbScanCodeSpecKeyEvent []UsbScanCodeSpecKeyEvent `xml:"UsbScanCodeSpecKeyEvent,omitempty"` } @@ -4965,6 +5340,14 @@ func init() { t["ArrayOfVASAStorageArray"] = reflect.TypeOf((*ArrayOfVASAStorageArray)(nil)).Elem() } +type ArrayOfVASAStorageArrayDiscoverySvcInfo struct { + VASAStorageArrayDiscoverySvcInfo []VASAStorageArrayDiscoverySvcInfo `xml:"VASAStorageArrayDiscoverySvcInfo,omitempty"` +} + +func init() { + t["ArrayOfVASAStorageArrayDiscoverySvcInfo"] = reflect.TypeOf((*ArrayOfVASAStorageArrayDiscoverySvcInfo)(nil)).Elem() +} + type ArrayOfVAppCloneSpecNetworkMappingPair struct { VAppCloneSpecNetworkMappingPair []VAppCloneSpecNetworkMappingPair `xml:"VAppCloneSpecNetworkMappingPair,omitempty"` } @@ -5221,6 +5604,14 @@ func init() { t["ArrayOfVirtualDiskRuleSpec"] = reflect.TypeOf((*ArrayOfVirtualDiskRuleSpec)(nil)).Elem() } +type ArrayOfVirtualMachineBaseIndependentFilterSpec struct { + VirtualMachineBaseIndependentFilterSpec []BaseVirtualMachineBaseIndependentFilterSpec `xml:"VirtualMachineBaseIndependentFilterSpec,omitempty,typeattr"` +} + +func init() { + t["ArrayOfVirtualMachineBaseIndependentFilterSpec"] = reflect.TypeOf((*ArrayOfVirtualMachineBaseIndependentFilterSpec)(nil)).Elem() +} + type ArrayOfVirtualMachineBootOptionsBootableDevice struct { VirtualMachineBootOptionsBootableDevice []BaseVirtualMachineBootOptionsBootableDevice `xml:"VirtualMachineBootOptionsBootableDevice,omitempty,typeattr"` } @@ -5237,6 +5628,14 @@ func init() { t["ArrayOfVirtualMachineCdromInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineCdromInfo)(nil)).Elem() } +type ArrayOfVirtualMachineCertThumbprint struct { + VirtualMachineCertThumbprint []VirtualMachineCertThumbprint `xml:"VirtualMachineCertThumbprint,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineCertThumbprint"] = reflect.TypeOf((*ArrayOfVirtualMachineCertThumbprint)(nil)).Elem() +} + type ArrayOfVirtualMachineConfigInfoDatastoreUrlPair struct { VirtualMachineConfigInfoDatastoreUrlPair []VirtualMachineConfigInfoDatastoreUrlPair `xml:"VirtualMachineConfigInfoDatastoreUrlPair,omitempty"` } @@ -5253,6 +5652,22 @@ func init() { t["ArrayOfVirtualMachineConfigOptionDescriptor"] = reflect.TypeOf((*ArrayOfVirtualMachineConfigOptionDescriptor)(nil)).Elem() } +type ArrayOfVirtualMachineConfigSpec struct { + VirtualMachineConfigSpec []VirtualMachineConfigSpec `xml:"VirtualMachineConfigSpec,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineConfigSpec"] = reflect.TypeOf((*ArrayOfVirtualMachineConfigSpec)(nil)).Elem() +} + +type ArrayOfVirtualMachineConnection struct { + VirtualMachineConnection []BaseVirtualMachineConnection `xml:"VirtualMachineConnection,omitempty,typeattr"` +} + +func init() { + t["ArrayOfVirtualMachineConnection"] = reflect.TypeOf((*ArrayOfVirtualMachineConnection)(nil)).Elem() +} + type ArrayOfVirtualMachineCpuIdInfoSpec struct { VirtualMachineCpuIdInfoSpec []VirtualMachineCpuIdInfoSpec `xml:"VirtualMachineCpuIdInfoSpec,omitempty"` } @@ -5293,6 +5708,22 @@ func init() { t["ArrayOfVirtualMachineDisplayTopology"] = reflect.TypeOf((*ArrayOfVirtualMachineDisplayTopology)(nil)).Elem() } +type ArrayOfVirtualMachineDvxClassInfo struct { + VirtualMachineDvxClassInfo []VirtualMachineDvxClassInfo `xml:"VirtualMachineDvxClassInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineDvxClassInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineDvxClassInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineDynamicPassthroughInfo struct { + VirtualMachineDynamicPassthroughInfo []VirtualMachineDynamicPassthroughInfo `xml:"VirtualMachineDynamicPassthroughInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineDynamicPassthroughInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineDynamicPassthroughInfo)(nil)).Elem() +} + type ArrayOfVirtualMachineFeatureRequirement struct { VirtualMachineFeatureRequirement []VirtualMachineFeatureRequirement `xml:"VirtualMachineFeatureRequirement,omitempty"` } @@ -5437,6 +5868,14 @@ func init() { t["ArrayOfVirtualMachinePciSharedGpuPassthroughInfo"] = reflect.TypeOf((*ArrayOfVirtualMachinePciSharedGpuPassthroughInfo)(nil)).Elem() } +type ArrayOfVirtualMachinePrecisionClockInfo struct { + VirtualMachinePrecisionClockInfo []VirtualMachinePrecisionClockInfo `xml:"VirtualMachinePrecisionClockInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachinePrecisionClockInfo"] = reflect.TypeOf((*ArrayOfVirtualMachinePrecisionClockInfo)(nil)).Elem() +} + type ArrayOfVirtualMachineProfileDetailsDiskProfileDetails struct { VirtualMachineProfileDetailsDiskProfileDetails []VirtualMachineProfileDetailsDiskProfileDetails `xml:"VirtualMachineProfileDetailsDiskProfileDetails,omitempty"` } @@ -5461,6 +5900,14 @@ func init() { t["ArrayOfVirtualMachinePropertyRelation"] = reflect.TypeOf((*ArrayOfVirtualMachinePropertyRelation)(nil)).Elem() } +type ArrayOfVirtualMachineQuickStatsMemoryTierStats struct { + VirtualMachineQuickStatsMemoryTierStats []VirtualMachineQuickStatsMemoryTierStats `xml:"VirtualMachineQuickStatsMemoryTierStats,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineQuickStatsMemoryTierStats"] = reflect.TypeOf((*ArrayOfVirtualMachineQuickStatsMemoryTierStats)(nil)).Elem() +} + type ArrayOfVirtualMachineRelocateSpecDiskLocator struct { VirtualMachineRelocateSpecDiskLocator []VirtualMachineRelocateSpecDiskLocator `xml:"VirtualMachineRelocateSpecDiskLocator,omitempty"` } @@ -5557,6 +6004,54 @@ func init() { t["ArrayOfVirtualMachineVMCIDeviceFilterSpec"] = reflect.TypeOf((*ArrayOfVirtualMachineVMCIDeviceFilterSpec)(nil)).Elem() } +type ArrayOfVirtualMachineVcpuConfig struct { + VirtualMachineVcpuConfig []VirtualMachineVcpuConfig `xml:"VirtualMachineVcpuConfig,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineVcpuConfig"] = reflect.TypeOf((*ArrayOfVirtualMachineVcpuConfig)(nil)).Elem() +} + +type ArrayOfVirtualMachineVendorDeviceGroupInfo struct { + VirtualMachineVendorDeviceGroupInfo []VirtualMachineVendorDeviceGroupInfo `xml:"VirtualMachineVendorDeviceGroupInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineVendorDeviceGroupInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineVendorDeviceGroupInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineVendorDeviceGroupInfoComponentDeviceInfo struct { + VirtualMachineVendorDeviceGroupInfoComponentDeviceInfo []VirtualMachineVendorDeviceGroupInfoComponentDeviceInfo `xml:"VirtualMachineVendorDeviceGroupInfoComponentDeviceInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineVendorDeviceGroupInfoComponentDeviceInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineVendorDeviceGroupInfoComponentDeviceInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineVgpuDeviceInfo struct { + VirtualMachineVgpuDeviceInfo []VirtualMachineVgpuDeviceInfo `xml:"VirtualMachineVgpuDeviceInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineVgpuDeviceInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineVgpuDeviceInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineVgpuProfileInfo struct { + VirtualMachineVgpuProfileInfo []VirtualMachineVgpuProfileInfo `xml:"VirtualMachineVgpuProfileInfo,omitempty"` +} + +func init() { + t["ArrayOfVirtualMachineVgpuProfileInfo"] = reflect.TypeOf((*ArrayOfVirtualMachineVgpuProfileInfo)(nil)).Elem() +} + +type ArrayOfVirtualMachineVirtualDeviceGroupsDeviceGroup struct { + VirtualMachineVirtualDeviceGroupsDeviceGroup []BaseVirtualMachineVirtualDeviceGroupsDeviceGroup `xml:"VirtualMachineVirtualDeviceGroupsDeviceGroup,omitempty,typeattr"` +} + +func init() { + t["ArrayOfVirtualMachineVirtualDeviceGroupsDeviceGroup"] = reflect.TypeOf((*ArrayOfVirtualMachineVirtualDeviceGroupsDeviceGroup)(nil)).Elem() +} + type ArrayOfVirtualNicManagerNetConfig struct { VirtualNicManagerNetConfig []VirtualNicManagerNetConfig `xml:"VirtualNicManagerNetConfig,omitempty"` } @@ -5565,6 +6060,14 @@ func init() { t["ArrayOfVirtualNicManagerNetConfig"] = reflect.TypeOf((*ArrayOfVirtualNicManagerNetConfig)(nil)).Elem() } +type ArrayOfVirtualPCIPassthroughAllowedDevice struct { + VirtualPCIPassthroughAllowedDevice []VirtualPCIPassthroughAllowedDevice `xml:"VirtualPCIPassthroughAllowedDevice,omitempty"` +} + +func init() { + t["ArrayOfVirtualPCIPassthroughAllowedDevice"] = reflect.TypeOf((*ArrayOfVirtualPCIPassthroughAllowedDevice)(nil)).Elem() +} + type ArrayOfVirtualSCSISharing struct { VirtualSCSISharing []VirtualSCSISharing `xml:"VirtualSCSISharing,omitempty"` } @@ -6112,6 +6615,8 @@ type BaseConfigInfo struct { NativeSnapshotSupported *bool `xml:"nativeSnapshotSupported"` ChangedBlockTrackingEnabled *bool `xml:"changedBlockTrackingEnabled"` Backing BaseBaseConfigInfoBackingInfo `xml:"backing,typeattr"` + Metadata []KeyValue `xml:"metadata,omitempty"` + Vclock *VslmVClockInfo `xml:"vclock,omitempty"` Iofilter []string `xml:"iofilter,omitempty"` } @@ -6146,6 +6651,7 @@ type BaseConfigInfoFileBackingInfo struct { BackingObjectId string `xml:"backingObjectId,omitempty"` Parent BaseBaseConfigInfoFileBackingInfo `xml:"parent,omitempty,typeattr"` DeltaSizeInMB int64 `xml:"deltaSizeInMB,omitempty"` + KeyId *CryptoKeyId `xml:"keyId,omitempty"` } func init() { @@ -6163,6 +6669,69 @@ func init() { t["BaseConfigInfoRawDiskMappingBackingInfo"] = reflect.TypeOf((*BaseConfigInfoRawDiskMappingBackingInfo)(nil)).Elem() } +type BatchAddHostsToClusterRequestType struct { + This ManagedObjectReference `xml:"_this"` + Cluster ManagedObjectReference `xml:"cluster"` + NewHosts []FolderNewHostSpec `xml:"newHosts,omitempty"` + ExistingHosts []ManagedObjectReference `xml:"existingHosts,omitempty"` + CompResSpec BaseComputeResourceConfigSpec `xml:"compResSpec,omitempty,typeattr"` + DesiredState string `xml:"desiredState,omitempty"` +} + +func init() { + t["BatchAddHostsToClusterRequestType"] = reflect.TypeOf((*BatchAddHostsToClusterRequestType)(nil)).Elem() +} + +type BatchAddHostsToCluster_Task BatchAddHostsToClusterRequestType + +func init() { + t["BatchAddHostsToCluster_Task"] = reflect.TypeOf((*BatchAddHostsToCluster_Task)(nil)).Elem() +} + +type BatchAddHostsToCluster_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type BatchAddStandaloneHostsRequestType struct { + This ManagedObjectReference `xml:"_this"` + NewHosts []FolderNewHostSpec `xml:"newHosts,omitempty"` + CompResSpec BaseComputeResourceConfigSpec `xml:"compResSpec,omitempty,typeattr"` + AddConnected bool `xml:"addConnected"` +} + +func init() { + t["BatchAddStandaloneHostsRequestType"] = reflect.TypeOf((*BatchAddStandaloneHostsRequestType)(nil)).Elem() +} + +type BatchAddStandaloneHosts_Task BatchAddStandaloneHostsRequestType + +func init() { + t["BatchAddStandaloneHosts_Task"] = reflect.TypeOf((*BatchAddStandaloneHosts_Task)(nil)).Elem() +} + +type BatchAddStandaloneHosts_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type BatchQueryConnectInfo BatchQueryConnectInfoRequestType + +func init() { + t["BatchQueryConnectInfo"] = reflect.TypeOf((*BatchQueryConnectInfo)(nil)).Elem() +} + +type BatchQueryConnectInfoRequestType struct { + This ManagedObjectReference `xml:"_this"` + HostSpecs []HostConnectSpec `xml:"hostSpecs,omitempty"` +} + +func init() { + t["BatchQueryConnectInfoRequestType"] = reflect.TypeOf((*BatchQueryConnectInfoRequestType)(nil)).Elem() +} + +type BatchQueryConnectInfoResponse struct { + Returnval []DatacenterBasicConnectInfo `xml:"returnval,omitempty"` +} + type BatchResult struct { DynamicData @@ -6873,12 +7442,21 @@ func init() { type Capability struct { DynamicData - ProvisioningSupported bool `xml:"provisioningSupported"` - MultiHostSupported bool `xml:"multiHostSupported"` - UserShellAccessSupported bool `xml:"userShellAccessSupported"` - SupportedEVCMode []EVCMode `xml:"supportedEVCMode,omitempty"` - NetworkBackupAndRestoreSupported *bool `xml:"networkBackupAndRestoreSupported"` - FtDrsWithoutEvcSupported *bool `xml:"ftDrsWithoutEvcSupported"` + ProvisioningSupported bool `xml:"provisioningSupported"` + MultiHostSupported bool `xml:"multiHostSupported"` + UserShellAccessSupported bool `xml:"userShellAccessSupported"` + SupportedEVCMode []EVCMode `xml:"supportedEVCMode,omitempty"` + SupportedEVCGraphicsMode []FeatureEVCMode `xml:"supportedEVCGraphicsMode,omitempty"` + NetworkBackupAndRestoreSupported *bool `xml:"networkBackupAndRestoreSupported"` + FtDrsWithoutEvcSupported *bool `xml:"ftDrsWithoutEvcSupported"` + HciWorkflowSupported *bool `xml:"hciWorkflowSupported"` + ComputePolicyVersion int32 `xml:"computePolicyVersion,omitempty"` + ClusterPlacementSupported *bool `xml:"clusterPlacementSupported"` + LifecycleManagementSupported *bool `xml:"lifecycleManagementSupported"` + HostSeedingSupported *bool `xml:"hostSeedingSupported"` + ScalableSharesSupported *bool `xml:"scalableSharesSupported"` + HadcsSupported *bool `xml:"hadcsSupported"` + ConfigMgmtSupported *bool `xml:"configMgmtSupported"` } func init() { @@ -7058,6 +7636,26 @@ func init() { type ChangeOwnerResponse struct { } +type ChangePassword ChangePasswordRequestType + +func init() { + t["ChangePassword"] = reflect.TypeOf((*ChangePassword)(nil)).Elem() +} + +type ChangePasswordRequestType struct { + This ManagedObjectReference `xml:"_this"` + User string `xml:"user"` + OldPassword string `xml:"oldPassword"` + NewPassword string `xml:"newPassword"` +} + +func init() { + t["ChangePasswordRequestType"] = reflect.TypeOf((*ChangePasswordRequestType)(nil)).Elem() +} + +type ChangePasswordResponse struct { +} + type ChangesInfoEventArgument struct { DynamicData @@ -7174,8 +7772,9 @@ type CheckCompliance_TaskResponse struct { } type CheckConfigureEvcModeRequestType struct { - This ManagedObjectReference `xml:"_this"` - EvcModeKey string `xml:"evcModeKey"` + This ManagedObjectReference `xml:"_this"` + EvcModeKey string `xml:"evcModeKey"` + EvcGraphicsModeKey string `xml:"evcGraphicsModeKey,omitempty"` } func init() { @@ -7714,6 +8313,18 @@ func init() { t["ClusterAttemptedVmInfo"] = reflect.TypeOf((*ClusterAttemptedVmInfo)(nil)).Elem() } +type ClusterClusterInitialPlacementAction struct { + ClusterAction + + TargetHost *ManagedObjectReference `xml:"targetHost,omitempty"` + Pool ManagedObjectReference `xml:"pool"` + ConfigSpec *VirtualMachineConfigSpec `xml:"configSpec,omitempty"` +} + +func init() { + t["ClusterClusterInitialPlacementAction"] = reflect.TypeOf((*ClusterClusterInitialPlacementAction)(nil)).Elem() +} + type ClusterComplianceCheckedEvent struct { ClusterEvent @@ -7724,23 +8335,208 @@ func init() { t["ClusterComplianceCheckedEvent"] = reflect.TypeOf((*ClusterComplianceCheckedEvent)(nil)).Elem() } +type ClusterComputeResourceClusterConfigResult struct { + DynamicData + + FailedHosts []FolderFailedHostResult `xml:"failedHosts,omitempty"` + ConfiguredHosts []ManagedObjectReference `xml:"configuredHosts,omitempty"` +} + +func init() { + t["ClusterComputeResourceClusterConfigResult"] = reflect.TypeOf((*ClusterComputeResourceClusterConfigResult)(nil)).Elem() +} + +type ClusterComputeResourceDVSConfigurationValidation struct { + ClusterComputeResourceValidationResultBase + + IsDvsValid bool `xml:"isDvsValid"` + IsDvpgValid bool `xml:"isDvpgValid"` +} + +func init() { + t["ClusterComputeResourceDVSConfigurationValidation"] = reflect.TypeOf((*ClusterComputeResourceDVSConfigurationValidation)(nil)).Elem() +} + +type ClusterComputeResourceDVSSetting struct { + DynamicData + + DvSwitch ManagedObjectReference `xml:"dvSwitch"` + PnicDevices []string `xml:"pnicDevices,omitempty"` + DvPortgroupSetting []ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping `xml:"dvPortgroupSetting,omitempty"` +} + +func init() { + t["ClusterComputeResourceDVSSetting"] = reflect.TypeOf((*ClusterComputeResourceDVSSetting)(nil)).Elem() +} + +type ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping struct { + DynamicData + + DvPortgroup ManagedObjectReference `xml:"dvPortgroup"` + Service string `xml:"service"` +} + +func init() { + t["ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping"] = reflect.TypeOf((*ClusterComputeResourceDVSSettingDVPortgroupToServiceMapping)(nil)).Elem() +} + +type ClusterComputeResourceDvsProfile struct { + DynamicData + + DvsName string `xml:"dvsName,omitempty"` + DvSwitch *ManagedObjectReference `xml:"dvSwitch,omitempty"` + PnicDevices []string `xml:"pnicDevices,omitempty"` + DvPortgroupMapping []ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping `xml:"dvPortgroupMapping,omitempty"` +} + +func init() { + t["ClusterComputeResourceDvsProfile"] = reflect.TypeOf((*ClusterComputeResourceDvsProfile)(nil)).Elem() +} + +type ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping struct { + DynamicData + + DvPortgroupSpec *DVPortgroupConfigSpec `xml:"dvPortgroupSpec,omitempty"` + DvPortgroup *ManagedObjectReference `xml:"dvPortgroup,omitempty"` + Service string `xml:"service"` +} + +func init() { + t["ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping"] = reflect.TypeOf((*ClusterComputeResourceDvsProfileDVPortgroupSpecToServiceMapping)(nil)).Elem() +} + +type ClusterComputeResourceHCIConfigInfo struct { + DynamicData + + WorkflowState string `xml:"workflowState"` + DvsSetting []ClusterComputeResourceDVSSetting `xml:"dvsSetting,omitempty"` + ConfiguredHosts []ManagedObjectReference `xml:"configuredHosts,omitempty"` + HostConfigProfile *ClusterComputeResourceHostConfigurationProfile `xml:"hostConfigProfile,omitempty"` +} + +func init() { + t["ClusterComputeResourceHCIConfigInfo"] = reflect.TypeOf((*ClusterComputeResourceHCIConfigInfo)(nil)).Elem() +} + +type ClusterComputeResourceHCIConfigSpec struct { + DynamicData + + DvsProf []ClusterComputeResourceDvsProfile `xml:"dvsProf,omitempty"` + HostConfigProfile *ClusterComputeResourceHostConfigurationProfile `xml:"hostConfigProfile,omitempty"` + VSanConfigSpec *SDDCBase `xml:"vSanConfigSpec,omitempty"` + VcProf *ClusterComputeResourceVCProfile `xml:"vcProf,omitempty"` +} + +func init() { + t["ClusterComputeResourceHCIConfigSpec"] = reflect.TypeOf((*ClusterComputeResourceHCIConfigSpec)(nil)).Elem() +} + +type ClusterComputeResourceHostConfigurationInput struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + HostVmkNics []ClusterComputeResourceHostVmkNicInfo `xml:"hostVmkNics,omitempty"` + AllowedInNonMaintenanceMode *bool `xml:"allowedInNonMaintenanceMode"` +} + +func init() { + t["ClusterComputeResourceHostConfigurationInput"] = reflect.TypeOf((*ClusterComputeResourceHostConfigurationInput)(nil)).Elem() +} + +type ClusterComputeResourceHostConfigurationProfile struct { + DynamicData + + DateTimeConfig *HostDateTimeConfig `xml:"dateTimeConfig,omitempty"` + LockdownMode HostLockdownMode `xml:"lockdownMode,omitempty"` +} + +func init() { + t["ClusterComputeResourceHostConfigurationProfile"] = reflect.TypeOf((*ClusterComputeResourceHostConfigurationProfile)(nil)).Elem() +} + +type ClusterComputeResourceHostConfigurationValidation struct { + ClusterComputeResourceValidationResultBase + + Host ManagedObjectReference `xml:"host"` + IsDvsSettingValid *bool `xml:"isDvsSettingValid"` + IsVmknicSettingValid *bool `xml:"isVmknicSettingValid"` + IsNtpSettingValid *bool `xml:"isNtpSettingValid"` + IsLockdownModeValid *bool `xml:"isLockdownModeValid"` +} + +func init() { + t["ClusterComputeResourceHostConfigurationValidation"] = reflect.TypeOf((*ClusterComputeResourceHostConfigurationValidation)(nil)).Elem() +} + +type ClusterComputeResourceHostVmkNicInfo struct { + DynamicData + + NicSpec HostVirtualNicSpec `xml:"nicSpec"` + Service string `xml:"service"` +} + +func init() { + t["ClusterComputeResourceHostVmkNicInfo"] = reflect.TypeOf((*ClusterComputeResourceHostVmkNicInfo)(nil)).Elem() +} + type ClusterComputeResourceSummary struct { ComputeResourceSummary - CurrentFailoverLevel int32 `xml:"currentFailoverLevel"` - AdmissionControlInfo BaseClusterDasAdmissionControlInfo `xml:"admissionControlInfo,omitempty,typeattr"` - NumVmotions int32 `xml:"numVmotions"` - TargetBalance int32 `xml:"targetBalance,omitempty"` - CurrentBalance int32 `xml:"currentBalance,omitempty"` - UsageSummary *ClusterUsageSummary `xml:"usageSummary,omitempty"` - CurrentEVCModeKey string `xml:"currentEVCModeKey,omitempty"` - DasData BaseClusterDasData `xml:"dasData,omitempty,typeattr"` + CurrentFailoverLevel int32 `xml:"currentFailoverLevel"` + AdmissionControlInfo BaseClusterDasAdmissionControlInfo `xml:"admissionControlInfo,omitempty,typeattr"` + NumVmotions int32 `xml:"numVmotions"` + TargetBalance int32 `xml:"targetBalance,omitempty"` + CurrentBalance int32 `xml:"currentBalance,omitempty"` + DrsScore int32 `xml:"drsScore,omitempty"` + NumVmsPerDrsScoreBucket []int32 `xml:"numVmsPerDrsScoreBucket,omitempty"` + UsageSummary *ClusterUsageSummary `xml:"usageSummary,omitempty"` + CurrentEVCModeKey string `xml:"currentEVCModeKey,omitempty"` + CurrentEVCGraphicsModeKey string `xml:"currentEVCGraphicsModeKey,omitempty"` + DasData BaseClusterDasData `xml:"dasData,omitempty,typeattr"` + ClusterMaintenanceModeStatus string `xml:"clusterMaintenanceModeStatus,omitempty"` + VcsHealthStatus string `xml:"vcsHealthStatus,omitempty"` + VcsSlots []ClusterComputeResourceVcsSlots `xml:"vcsSlots,omitempty"` } func init() { t["ClusterComputeResourceSummary"] = reflect.TypeOf((*ClusterComputeResourceSummary)(nil)).Elem() } +type ClusterComputeResourceVCProfile struct { + DynamicData + + ClusterSpec *ClusterConfigSpecEx `xml:"clusterSpec,omitempty"` + EvcModeKey string `xml:"evcModeKey,omitempty"` + EvcGraphicsModeKey string `xml:"evcGraphicsModeKey,omitempty"` +} + +func init() { + t["ClusterComputeResourceVCProfile"] = reflect.TypeOf((*ClusterComputeResourceVCProfile)(nil)).Elem() +} + +type ClusterComputeResourceValidationResultBase struct { + DynamicData + + Info []LocalizableMessage `xml:"info,omitempty"` +} + +func init() { + t["ClusterComputeResourceValidationResultBase"] = reflect.TypeOf((*ClusterComputeResourceValidationResultBase)(nil)).Elem() +} + +type ClusterComputeResourceVcsSlots struct { + DynamicData + + SystemId string `xml:"systemId,omitempty"` + Host ManagedObjectReference `xml:"host"` + Datastore []ManagedObjectReference `xml:"datastore,omitempty"` + TotalSlots int32 `xml:"totalSlots"` +} + +func init() { + t["ClusterComputeResourceVcsSlots"] = reflect.TypeOf((*ClusterComputeResourceVcsSlots)(nil)).Elem() +} + type ClusterConfigInfo struct { DynamicData @@ -7758,6 +8554,7 @@ func init() { type ClusterConfigInfoEx struct { ComputeResourceConfigInfo + SystemVMsConfig *ClusterSystemVMsConfigInfo `xml:"systemVMsConfig,omitempty"` DasConfig ClusterDasConfigInfo `xml:"dasConfig"` DasVmConfig []ClusterDasVmConfigInfo `xml:"dasVmConfig,omitempty"` DrsConfig ClusterDrsConfigInfo `xml:"drsConfig"` @@ -7772,6 +8569,7 @@ type ClusterConfigInfoEx struct { Group []BaseClusterGroupInfo `xml:"group,omitempty,typeattr"` InfraUpdateHaConfig *ClusterInfraUpdateHaConfigInfo `xml:"infraUpdateHaConfig,omitempty"` ProactiveDrsConfig *ClusterProactiveDrsConfigInfo `xml:"proactiveDrsConfig,omitempty"` + CryptoConfig *ClusterCryptoConfigInfo `xml:"cryptoConfig,omitempty"` } func init() { @@ -7795,6 +8593,7 @@ func init() { type ClusterConfigSpecEx struct { ComputeResourceConfigSpec + SystemVMsConfig *ClusterSystemVMsConfigSpec `xml:"systemVMsConfig,omitempty"` DasConfig *ClusterDasConfigInfo `xml:"dasConfig,omitempty"` DasVmConfigSpec []ClusterDasVmConfigSpec `xml:"dasVmConfigSpec,omitempty"` DrsConfig *ClusterDrsConfigInfo `xml:"drsConfig,omitempty"` @@ -7809,6 +8608,8 @@ type ClusterConfigSpecEx struct { GroupSpec []ClusterGroupSpec `xml:"groupSpec,omitempty"` InfraUpdateHaConfig *ClusterInfraUpdateHaConfigInfo `xml:"infraUpdateHaConfig,omitempty"` ProactiveDrsConfig *ClusterProactiveDrsConfigInfo `xml:"proactiveDrsConfig,omitempty"` + InHciWorkflow *bool `xml:"inHciWorkflow"` + CryptoConfig *ClusterCryptoConfigInfo `xml:"cryptoConfig,omitempty"` } func init() { @@ -7825,6 +8626,16 @@ func init() { t["ClusterCreatedEvent"] = reflect.TypeOf((*ClusterCreatedEvent)(nil)).Elem() } +type ClusterCryptoConfigInfo struct { + DynamicData + + CryptoMode string `xml:"cryptoMode,omitempty"` +} + +func init() { + t["ClusterCryptoConfigInfo"] = reflect.TypeOf((*ClusterCryptoConfigInfo)(nil)).Elem() +} + type ClusterDasAamHostInfo struct { ClusterDasHostInfo @@ -7860,7 +8671,8 @@ func init() { type ClusterDasAdmissionControlPolicy struct { DynamicData - ResourceReductionToToleratePercent int32 `xml:"resourceReductionToToleratePercent,omitempty"` + ResourceReductionToToleratePercent *int32 `xml:"resourceReductionToToleratePercent"` + PMemAdmissionControlEnabled *bool `xml:"pMemAdmissionControlEnabled"` } func init() { @@ -8049,6 +8861,16 @@ func init() { t["ClusterDasVmSettings"] = reflect.TypeOf((*ClusterDasVmSettings)(nil)).Elem() } +type ClusterDatastoreUpdateSpec struct { + ArrayUpdateSpec + + Datastore *ManagedObjectReference `xml:"datastore,omitempty"` +} + +func init() { + t["ClusterDatastoreUpdateSpec"] = reflect.TypeOf((*ClusterDatastoreUpdateSpec)(nil)).Elem() +} + type ClusterDependencyRuleInfo struct { ClusterRuleInfo @@ -8110,6 +8932,7 @@ type ClusterDrsConfigInfo struct { EnableVmBehaviorOverrides *bool `xml:"enableVmBehaviorOverrides"` DefaultVmBehavior DrsBehavior `xml:"defaultVmBehavior,omitempty"` VmotionRate int32 `xml:"vmotionRate,omitempty"` + ScaleDescendantsShares string `xml:"scaleDescendantsShares,omitempty"` Option []BaseOptionValue `xml:"option,omitempty,typeattr"` } @@ -8329,6 +9152,7 @@ type ClusterFailoverResourcesAdmissionControlInfo struct { CurrentCpuFailoverResourcesPercent int32 `xml:"currentCpuFailoverResourcesPercent"` CurrentMemoryFailoverResourcesPercent int32 `xml:"currentMemoryFailoverResourcesPercent"` + CurrentPMemFailoverResourcesPercent int32 `xml:"currentPMemFailoverResourcesPercent,omitempty"` } func init() { @@ -8338,10 +9162,12 @@ func init() { type ClusterFailoverResourcesAdmissionControlPolicy struct { ClusterDasAdmissionControlPolicy - CpuFailoverResourcesPercent int32 `xml:"cpuFailoverResourcesPercent"` - MemoryFailoverResourcesPercent int32 `xml:"memoryFailoverResourcesPercent"` - FailoverLevel int32 `xml:"failoverLevel,omitempty"` - AutoComputePercentages *bool `xml:"autoComputePercentages"` + CpuFailoverResourcesPercent int32 `xml:"cpuFailoverResourcesPercent"` + MemoryFailoverResourcesPercent int32 `xml:"memoryFailoverResourcesPercent"` + FailoverLevel int32 `xml:"failoverLevel,omitempty"` + AutoComputePercentages *bool `xml:"autoComputePercentages"` + PMemFailoverResourcesPercent int32 `xml:"pMemFailoverResourcesPercent,omitempty"` + AutoComputePMemFailoverResourcesPercent *bool `xml:"autoComputePMemFailoverResourcesPercent"` } func init() { @@ -8523,6 +9349,28 @@ func init() { t["ClusterPowerOnVmResult"] = reflect.TypeOf((*ClusterPowerOnVmResult)(nil)).Elem() } +type ClusterPreemptibleVmPairInfo struct { + DynamicData + + Id int32 `xml:"id,omitempty"` + MonitoredVm ManagedObjectReference `xml:"monitoredVm"` + PreemptibleVm ManagedObjectReference `xml:"preemptibleVm"` +} + +func init() { + t["ClusterPreemptibleVmPairInfo"] = reflect.TypeOf((*ClusterPreemptibleVmPairInfo)(nil)).Elem() +} + +type ClusterPreemptibleVmPairSpec struct { + ArrayUpdateSpec + + Info *ClusterPreemptibleVmPairInfo `xml:"info,omitempty"` +} + +func init() { + t["ClusterPreemptibleVmPairSpec"] = reflect.TypeOf((*ClusterPreemptibleVmPairSpec)(nil)).Elem() +} + type ClusterProactiveDrsConfigInfo struct { DynamicData @@ -8672,6 +9520,40 @@ func init() { t["ClusterStatusChangedEvent"] = reflect.TypeOf((*ClusterStatusChangedEvent)(nil)).Elem() } +type ClusterSystemVMsConfigInfo struct { + DynamicData + + AllowedDatastores []ManagedObjectReference `xml:"allowedDatastores,omitempty"` + NotAllowedDatastores []ManagedObjectReference `xml:"notAllowedDatastores,omitempty"` + DsTagCategoriesToExclude []string `xml:"dsTagCategoriesToExclude,omitempty"` +} + +func init() { + t["ClusterSystemVMsConfigInfo"] = reflect.TypeOf((*ClusterSystemVMsConfigInfo)(nil)).Elem() +} + +type ClusterSystemVMsConfigSpec struct { + DynamicData + + AllowedDatastores []ClusterDatastoreUpdateSpec `xml:"allowedDatastores,omitempty"` + NotAllowedDatastores []ClusterDatastoreUpdateSpec `xml:"notAllowedDatastores,omitempty"` + DsTagCategoriesToExclude []ClusterTagCategoryUpdateSpec `xml:"dsTagCategoriesToExclude,omitempty"` +} + +func init() { + t["ClusterSystemVMsConfigSpec"] = reflect.TypeOf((*ClusterSystemVMsConfigSpec)(nil)).Elem() +} + +type ClusterTagCategoryUpdateSpec struct { + ArrayUpdateSpec + + Category string `xml:"category,omitempty"` +} + +func init() { + t["ClusterTagCategoryUpdateSpec"] = reflect.TypeOf((*ClusterTagCategoryUpdateSpec)(nil)).Elem() +} + type ClusterUsageSummary struct { DynamicData @@ -8936,6 +9818,7 @@ type ComputeResourceConfigInfo struct { VmSwapPlacement string `xml:"vmSwapPlacement"` SpbmEnabled *bool `xml:"spbmEnabled"` DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` + MaximumHardwareVersionKey string `xml:"maximumHardwareVersionKey,omitempty"` } func init() { @@ -8945,9 +9828,12 @@ func init() { type ComputeResourceConfigSpec struct { DynamicData - VmSwapPlacement string `xml:"vmSwapPlacement,omitempty"` - SpbmEnabled *bool `xml:"spbmEnabled"` - DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` + VmSwapPlacement string `xml:"vmSwapPlacement,omitempty"` + SpbmEnabled *bool `xml:"spbmEnabled"` + DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` + DesiredSoftwareSpec *DesiredSoftwareSpec `xml:"desiredSoftwareSpec,omitempty"` + MaximumHardwareVersionKey string `xml:"maximumHardwareVersionKey,omitempty"` + EnableConfigManager *bool `xml:"enableConfigManager"` } func init() { @@ -9013,6 +9899,7 @@ type ConfigTarget struct { NumCpus int32 `xml:"numCpus"` NumCpuCores int32 `xml:"numCpuCores"` NumNumaNodes int32 `xml:"numNumaNodes"` + MaxCpusPerHost int32 `xml:"maxCpusPerHost,omitempty"` SmcPresent *bool `xml:"smcPresent"` Datastore []VirtualMachineDatastoreInfo `xml:"datastore,omitempty"` Network []VirtualMachineNetworkInfo `xml:"network,omitempty"` @@ -9030,6 +9917,7 @@ type ConfigTarget struct { ScsiDisk []VirtualMachineScsiDiskDeviceInfo `xml:"scsiDisk,omitempty"` IdeDisk []VirtualMachineIdeDiskDeviceInfo `xml:"ideDisk,omitempty"` MaxMemMBOptimalPerf int32 `xml:"maxMemMBOptimalPerf"` + SupportedMaxMemMB int32 `xml:"supportedMaxMemMB,omitempty"` ResourcePool *ResourcePoolRuntimeInfo `xml:"resourcePool,omitempty"` AutoVmotion *bool `xml:"autoVmotion"` PciPassthrough []BaseVirtualMachinePciPassthroughInfo `xml:"pciPassthrough,omitempty,typeattr"` @@ -9037,6 +9925,15 @@ type ConfigTarget struct { VFlashModule []VirtualMachineVFlashModuleInfo `xml:"vFlashModule,omitempty"` SharedGpuPassthroughTypes []VirtualMachinePciSharedGpuPassthroughInfo `xml:"sharedGpuPassthroughTypes,omitempty"` AvailablePersistentMemoryReservationMB int64 `xml:"availablePersistentMemoryReservationMB,omitempty"` + DynamicPassthrough []VirtualMachineDynamicPassthroughInfo `xml:"dynamicPassthrough,omitempty"` + SgxTargetInfo *VirtualMachineSgxTargetInfo `xml:"sgxTargetInfo,omitempty"` + PrecisionClockInfo []VirtualMachinePrecisionClockInfo `xml:"precisionClockInfo,omitempty"` + SevSupported *bool `xml:"sevSupported"` + VgpuDeviceInfo []VirtualMachineVgpuDeviceInfo `xml:"vgpuDeviceInfo,omitempty"` + VgpuProfileInfo []VirtualMachineVgpuProfileInfo `xml:"vgpuProfileInfo,omitempty"` + VendorDeviceGroupInfo []VirtualMachineVendorDeviceGroupInfo `xml:"vendorDeviceGroupInfo,omitempty"` + MaxSimultaneousThreads int32 `xml:"maxSimultaneousThreads,omitempty"` + DvxClassInfo []VirtualMachineDvxClassInfo `xml:"dvxClassInfo,omitempty"` } func init() { @@ -9101,8 +9998,9 @@ type ConfigureDatastorePrincipalResponse struct { } type ConfigureEvcModeRequestType struct { - This ManagedObjectReference `xml:"_this"` - EvcModeKey string `xml:"evcModeKey"` + This ManagedObjectReference `xml:"_this"` + EvcModeKey string `xml:"evcModeKey"` + EvcGraphicsModeKey string `xml:"evcGraphicsModeKey,omitempty"` } func init() { @@ -9119,6 +10017,26 @@ type ConfigureEvcMode_TaskResponse struct { Returnval ManagedObjectReference `xml:"returnval"` } +type ConfigureHCIRequestType struct { + This ManagedObjectReference `xml:"_this"` + ClusterSpec ClusterComputeResourceHCIConfigSpec `xml:"clusterSpec"` + HostInputs []ClusterComputeResourceHostConfigurationInput `xml:"hostInputs,omitempty"` +} + +func init() { + t["ConfigureHCIRequestType"] = reflect.TypeOf((*ConfigureHCIRequestType)(nil)).Elem() +} + +type ConfigureHCI_Task ConfigureHCIRequestType + +func init() { + t["ConfigureHCI_Task"] = reflect.TypeOf((*ConfigureHCI_Task)(nil)).Elem() +} + +type ConfigureHCI_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + type ConfigureHostCacheRequestType struct { This ManagedObjectReference `xml:"_this"` Spec HostCacheConfigurationSpec `xml:"spec"` @@ -9259,6 +10177,43 @@ func init() { t["ConflictingDatastoreFoundFault"] = reflect.TypeOf((*ConflictingDatastoreFoundFault)(nil)).Elem() } +type ConnectNvmeController ConnectNvmeControllerRequestType + +func init() { + t["ConnectNvmeController"] = reflect.TypeOf((*ConnectNvmeController)(nil)).Elem() +} + +type ConnectNvmeControllerExRequestType struct { + This ManagedObjectReference `xml:"_this"` + ConnectSpec []HostNvmeConnectSpec `xml:"connectSpec,omitempty"` +} + +func init() { + t["ConnectNvmeControllerExRequestType"] = reflect.TypeOf((*ConnectNvmeControllerExRequestType)(nil)).Elem() +} + +type ConnectNvmeControllerEx_Task ConnectNvmeControllerExRequestType + +func init() { + t["ConnectNvmeControllerEx_Task"] = reflect.TypeOf((*ConnectNvmeControllerEx_Task)(nil)).Elem() +} + +type ConnectNvmeControllerEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type ConnectNvmeControllerRequestType struct { + This ManagedObjectReference `xml:"_this"` + ConnectSpec HostNvmeConnectSpec `xml:"connectSpec"` +} + +func init() { + t["ConnectNvmeControllerRequestType"] = reflect.TypeOf((*ConnectNvmeControllerRequestType)(nil)).Elem() +} + +type ConnectNvmeControllerResponse struct { +} + type ConnectedIso struct { OvfExport @@ -9756,6 +10711,7 @@ type CreateDirectoryRequestType struct { Datastore ManagedObjectReference `xml:"datastore"` DisplayName string `xml:"displayName,omitempty"` Policy string `xml:"policy,omitempty"` + Size int64 `xml:"size,omitempty"` } func init() { @@ -10023,6 +10979,43 @@ type CreateNvdimmNamespace_TaskResponse struct { Returnval ManagedObjectReference `xml:"returnval"` } +type CreateNvdimmPMemNamespaceRequestType struct { + This ManagedObjectReference `xml:"_this"` + CreateSpec NvdimmPMemNamespaceCreateSpec `xml:"createSpec"` +} + +func init() { + t["CreateNvdimmPMemNamespaceRequestType"] = reflect.TypeOf((*CreateNvdimmPMemNamespaceRequestType)(nil)).Elem() +} + +type CreateNvdimmPMemNamespace_Task CreateNvdimmPMemNamespaceRequestType + +func init() { + t["CreateNvdimmPMemNamespace_Task"] = reflect.TypeOf((*CreateNvdimmPMemNamespace_Task)(nil)).Elem() +} + +type CreateNvdimmPMemNamespace_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type CreateNvmeOverRdmaAdapter CreateNvmeOverRdmaAdapterRequestType + +func init() { + t["CreateNvmeOverRdmaAdapter"] = reflect.TypeOf((*CreateNvmeOverRdmaAdapter)(nil)).Elem() +} + +type CreateNvmeOverRdmaAdapterRequestType struct { + This ManagedObjectReference `xml:"_this"` + RdmaDeviceName string `xml:"rdmaDeviceName"` +} + +func init() { + t["CreateNvmeOverRdmaAdapterRequestType"] = reflect.TypeOf((*CreateNvmeOverRdmaAdapterRequestType)(nil)).Elem() +} + +type CreateNvmeOverRdmaAdapterResponse struct { +} + type CreateObjectScheduledTask CreateObjectScheduledTaskRequestType func init() { @@ -10261,6 +11254,24 @@ type CreateSnapshot_TaskResponse struct { Returnval ManagedObjectReference `xml:"returnval"` } +type CreateSoftwareAdapter CreateSoftwareAdapterRequestType + +func init() { + t["CreateSoftwareAdapter"] = reflect.TypeOf((*CreateSoftwareAdapter)(nil)).Elem() +} + +type CreateSoftwareAdapterRequestType struct { + This ManagedObjectReference `xml:"_this"` + Spec BaseHostHbaCreateSpec `xml:"spec,typeattr"` +} + +func init() { + t["CreateSoftwareAdapterRequestType"] = reflect.TypeOf((*CreateSoftwareAdapterRequestType)(nil)).Elem() +} + +type CreateSoftwareAdapterResponse struct { +} + type CreateStoragePod CreateStoragePodRequestType func init() { @@ -10507,15 +11518,33 @@ func init() { type CryptoKeyResult struct { DynamicData - KeyId CryptoKeyId `xml:"keyId"` - Success bool `xml:"success"` - Reason string `xml:"reason,omitempty"` + KeyId CryptoKeyId `xml:"keyId"` + Success bool `xml:"success"` + Reason string `xml:"reason,omitempty"` + Fault *LocalizedMethodFault `xml:"fault,omitempty"` } func init() { t["CryptoKeyResult"] = reflect.TypeOf((*CryptoKeyResult)(nil)).Elem() } +type CryptoManagerHostDisable CryptoManagerHostDisableRequestType + +func init() { + t["CryptoManagerHostDisable"] = reflect.TypeOf((*CryptoManagerHostDisable)(nil)).Elem() +} + +type CryptoManagerHostDisableRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["CryptoManagerHostDisableRequestType"] = reflect.TypeOf((*CryptoManagerHostDisableRequestType)(nil)).Elem() +} + +type CryptoManagerHostDisableResponse struct { +} + type CryptoManagerHostEnable CryptoManagerHostEnableRequestType func init() { @@ -10573,6 +11602,8 @@ type CryptoManagerKmipClusterStatus struct { DynamicData ClusterId KeyProviderId `xml:"clusterId"` + OverallStatus ManagedEntityStatus `xml:"overallStatus,omitempty"` + ManagementType string `xml:"managementType,omitempty"` Servers []CryptoManagerKmipServerStatus `xml:"servers"` ClientCertInfo *CryptoManagerKmipCertificateInfo `xml:"clientCertInfo,omitempty"` } @@ -10581,6 +11612,21 @@ func init() { t["CryptoManagerKmipClusterStatus"] = reflect.TypeOf((*CryptoManagerKmipClusterStatus)(nil)).Elem() } +type CryptoManagerKmipCryptoKeyStatus struct { + DynamicData + + KeyId CryptoKeyId `xml:"keyId"` + KeyAvailable *bool `xml:"keyAvailable"` + Reason string `xml:"reason,omitempty"` + EncryptedVMs []ManagedObjectReference `xml:"encryptedVMs,omitempty"` + AffectedHosts []ManagedObjectReference `xml:"affectedHosts,omitempty"` + ReferencedByTags []string `xml:"referencedByTags,omitempty"` +} + +func init() { + t["CryptoManagerKmipCryptoKeyStatus"] = reflect.TypeOf((*CryptoManagerKmipCryptoKeyStatus)(nil)).Elem() +} + type CryptoManagerKmipServerCertInfo struct { DynamicData @@ -10821,6 +11867,17 @@ func init() { t["CustomizationAutoIpV6Generator"] = reflect.TypeOf((*CustomizationAutoIpV6Generator)(nil)).Elem() } +type CustomizationCloudinitPrep struct { + CustomizationIdentitySettings + + Metadata string `xml:"metadata"` + Userdata string `xml:"userdata,omitempty"` +} + +func init() { + t["CustomizationCloudinitPrep"] = reflect.TypeOf((*CustomizationCloudinitPrep)(nil)).Elem() +} + type CustomizationCustomIpGenerator struct { CustomizationIpGenerator @@ -10879,6 +11936,8 @@ func init() { type CustomizationFailed struct { CustomizationEvent + + Reason string `xml:"reason,omitempty"` } func init() { @@ -11064,6 +12123,7 @@ type CustomizationLinuxPrep struct { Domain string `xml:"domain"` TimeZone string `xml:"timeZone,omitempty"` HwClockUTC *bool `xml:"hwClockUTC"` + ScriptText string `xml:"scriptText,omitempty"` } func init() { @@ -11311,6 +12371,28 @@ func init() { t["CustomizationWinOptions"] = reflect.TypeOf((*CustomizationWinOptions)(nil)).Elem() } +type CustomizeGuestRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` + Spec CustomizationSpec `xml:"spec"` + ConfigParams []BaseOptionValue `xml:"configParams,omitempty,typeattr"` +} + +func init() { + t["CustomizeGuestRequestType"] = reflect.TypeOf((*CustomizeGuestRequestType)(nil)).Elem() +} + +type CustomizeGuest_Task CustomizeGuestRequestType + +func init() { + t["CustomizeGuest_Task"] = reflect.TypeOf((*CustomizeGuest_Task)(nil)).Elem() +} + +type CustomizeGuest_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + type CustomizeVMRequestType struct { This ManagedObjectReference `xml:"_this"` Spec CustomizationSpec `xml:"spec"` @@ -11433,6 +12515,7 @@ type DVPortgroupConfigInfo struct { DefaultPortConfig BaseDVPortSetting `xml:"defaultPortConfig,omitempty,typeattr"` Description string `xml:"description,omitempty"` Type string `xml:"type"` + BackingType string `xml:"backingType,omitempty"` Policy BaseDVPortgroupPolicy `xml:"policy,typeattr"` PortNameFormat string `xml:"portNameFormat,omitempty"` Scope []ManagedObjectReference `xml:"scope,omitempty"` @@ -11441,6 +12524,10 @@ type DVPortgroupConfigInfo struct { AutoExpand *bool `xml:"autoExpand"` VmVnicNetworkResourcePoolKey string `xml:"vmVnicNetworkResourcePoolKey,omitempty"` Uplink *bool `xml:"uplink"` + TransportZoneUuid string `xml:"transportZoneUuid,omitempty"` + TransportZoneName string `xml:"transportZoneName,omitempty"` + LogicalSwitchUuid string `xml:"logicalSwitchUuid,omitempty"` + SegmentId string `xml:"segmentId,omitempty"` } func init() { @@ -11457,11 +12544,16 @@ type DVPortgroupConfigSpec struct { DefaultPortConfig BaseDVPortSetting `xml:"defaultPortConfig,omitempty,typeattr"` Description string `xml:"description,omitempty"` Type string `xml:"type,omitempty"` + BackingType string `xml:"backingType,omitempty"` Scope []ManagedObjectReference `xml:"scope,omitempty"` Policy BaseDVPortgroupPolicy `xml:"policy,omitempty,typeattr"` VendorSpecificConfig []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificConfig,omitempty"` AutoExpand *bool `xml:"autoExpand"` VmVnicNetworkResourcePoolKey string `xml:"vmVnicNetworkResourcePoolKey,omitempty"` + TransportZoneUuid string `xml:"transportZoneUuid,omitempty"` + TransportZoneName string `xml:"transportZoneName,omitempty"` + LogicalSwitchUuid string `xml:"logicalSwitchUuid,omitempty"` + SegmentId string `xml:"segmentId,omitempty"` } func init() { @@ -11833,6 +12925,17 @@ type DVSManagerLookupDvPortGroupResponse struct { Returnval *ManagedObjectReference `xml:"returnval,omitempty"` } +type DVSManagerPhysicalNicsList struct { + DynamicData + + Host ManagedObjectReference `xml:"host"` + PhysicalNics []PhysicalNic `xml:"physicalNics,omitempty"` +} + +func init() { + t["DVSManagerPhysicalNicsList"] = reflect.TypeOf((*DVSManagerPhysicalNicsList)(nil)).Elem() +} + type DVSNameArrayUplinkPortPolicy struct { DVSUplinkPortPolicy @@ -12187,10 +13290,28 @@ func init() { t["DatabaseSizeParam"] = reflect.TypeOf((*DatabaseSizeParam)(nil)).Elem() } +type DatacenterBasicConnectInfo struct { + DynamicData + + Hostname string `xml:"hostname,omitempty"` + Error *LocalizedMethodFault `xml:"error,omitempty"` + ServerIp string `xml:"serverIp,omitempty"` + NumVm int32 `xml:"numVm,omitempty"` + NumPoweredOnVm int32 `xml:"numPoweredOnVm,omitempty"` + HostProductInfo *AboutInfo `xml:"hostProductInfo,omitempty"` + HardwareVendor string `xml:"hardwareVendor,omitempty"` + HardwareModel string `xml:"hardwareModel,omitempty"` +} + +func init() { + t["DatacenterBasicConnectInfo"] = reflect.TypeOf((*DatacenterBasicConnectInfo)(nil)).Elem() +} + type DatacenterConfigInfo struct { DynamicData DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` + MaximumHardwareVersionKey string `xml:"maximumHardwareVersionKey,omitempty"` } func init() { @@ -12201,6 +13322,7 @@ type DatacenterConfigSpec struct { DynamicData DefaultHardwareVersionKey string `xml:"defaultHardwareVersionKey,omitempty"` + MaximumHardwareVersionKey string `xml:"maximumHardwareVersionKey,omitempty"` } func init() { @@ -12288,6 +13410,7 @@ type DatastoreCapability struct { VsanSparseSupported *bool `xml:"vsanSparseSupported"` UpitSupported *bool `xml:"upitSupported"` VmdkExpandSupported *bool `xml:"vmdkExpandSupported"` + ClusteredVmdkSupported *bool `xml:"clusteredVmdkSupported"` } func init() { @@ -12459,6 +13582,7 @@ type DatastoreInfo struct { MaxMemoryFileSize int64 `xml:"maxMemoryFileSize,omitempty"` Timestamp *time.Time `xml:"timestamp"` ContainerId string `xml:"containerId,omitempty"` + AliasOf string `xml:"aliasOf,omitempty"` } func init() { @@ -12909,6 +14033,26 @@ type DeleteSnapshot_TaskResponse struct { Returnval ManagedObjectReference `xml:"returnval"` } +type DeleteVStorageObjectExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` +} + +func init() { + t["DeleteVStorageObjectExRequestType"] = reflect.TypeOf((*DeleteVStorageObjectExRequestType)(nil)).Elem() +} + +type DeleteVStorageObjectEx_Task DeleteVStorageObjectExRequestType + +func init() { + t["DeleteVStorageObjectEx_Task"] = reflect.TypeOf((*DeleteVStorageObjectEx_Task)(nil)).Elem() +} + +type DeleteVStorageObjectEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + type DeleteVStorageObjectRequestType struct { This ManagedObjectReference `xml:"_this"` Id ID `xml:"id"` @@ -13069,6 +14213,50 @@ func init() { type DeselectVnicResponse struct { } +type DesiredSoftwareSpec struct { + DynamicData + + BaseImageSpec DesiredSoftwareSpecBaseImageSpec `xml:"baseImageSpec"` + VendorAddOnSpec *DesiredSoftwareSpecVendorAddOnSpec `xml:"vendorAddOnSpec,omitempty"` + Components []DesiredSoftwareSpecComponentSpec `xml:"components,omitempty"` +} + +func init() { + t["DesiredSoftwareSpec"] = reflect.TypeOf((*DesiredSoftwareSpec)(nil)).Elem() +} + +type DesiredSoftwareSpecBaseImageSpec struct { + DynamicData + + Version string `xml:"version"` +} + +func init() { + t["DesiredSoftwareSpecBaseImageSpec"] = reflect.TypeOf((*DesiredSoftwareSpecBaseImageSpec)(nil)).Elem() +} + +type DesiredSoftwareSpecComponentSpec struct { + DynamicData + + Name string `xml:"name"` + Version string `xml:"version,omitempty"` +} + +func init() { + t["DesiredSoftwareSpecComponentSpec"] = reflect.TypeOf((*DesiredSoftwareSpecComponentSpec)(nil)).Elem() +} + +type DesiredSoftwareSpecVendorAddOnSpec struct { + DynamicData + + Name string `xml:"name"` + Version string `xml:"version"` +} + +func init() { + t["DesiredSoftwareSpecVendorAddOnSpec"] = reflect.TypeOf((*DesiredSoftwareSpecVendorAddOnSpec)(nil)).Elem() +} + type DestinationSwitchFull struct { CannotAccessNetwork } @@ -13495,6 +14683,17 @@ func init() { t["DeviceUnsupportedForVmVersionFault"] = reflect.TypeOf((*DeviceUnsupportedForVmVersionFault)(nil)).Elem() } +type DiagnosticManagerAuditRecordResult struct { + DynamicData + + Records []string `xml:"records,omitempty"` + NextToken string `xml:"nextToken"` +} + +func init() { + t["DiagnosticManagerAuditRecordResult"] = reflect.TypeOf((*DiagnosticManagerAuditRecordResult)(nil)).Elem() +} + type DiagnosticManagerBundleInfo struct { DynamicData @@ -13575,6 +14774,43 @@ func init() { t["DisableAdminNotSupportedFault"] = reflect.TypeOf((*DisableAdminNotSupportedFault)(nil)).Elem() } +type DisableAlarm DisableAlarmRequestType + +func init() { + t["DisableAlarm"] = reflect.TypeOf((*DisableAlarm)(nil)).Elem() +} + +type DisableAlarmRequestType struct { + This ManagedObjectReference `xml:"_this"` + Alarm ManagedObjectReference `xml:"alarm"` + Entity ManagedObjectReference `xml:"entity"` +} + +func init() { + t["DisableAlarmRequestType"] = reflect.TypeOf((*DisableAlarmRequestType)(nil)).Elem() +} + +type DisableAlarmResponse struct { +} + +type DisableClusteredVmdkSupport DisableClusteredVmdkSupportRequestType + +func init() { + t["DisableClusteredVmdkSupport"] = reflect.TypeOf((*DisableClusteredVmdkSupport)(nil)).Elem() +} + +type DisableClusteredVmdkSupportRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datastore ManagedObjectReference `xml:"datastore"` +} + +func init() { + t["DisableClusteredVmdkSupportRequestType"] = reflect.TypeOf((*DisableClusteredVmdkSupportRequestType)(nil)).Elem() +} + +type DisableClusteredVmdkSupportResponse struct { +} + type DisableEvcModeRequestType struct { This ManagedObjectReference `xml:"_this"` } @@ -13784,6 +15020,43 @@ type DisconnectHost_TaskResponse struct { Returnval ManagedObjectReference `xml:"returnval"` } +type DisconnectNvmeController DisconnectNvmeControllerRequestType + +func init() { + t["DisconnectNvmeController"] = reflect.TypeOf((*DisconnectNvmeController)(nil)).Elem() +} + +type DisconnectNvmeControllerExRequestType struct { + This ManagedObjectReference `xml:"_this"` + DisconnectSpec []HostNvmeDisconnectSpec `xml:"disconnectSpec,omitempty"` +} + +func init() { + t["DisconnectNvmeControllerExRequestType"] = reflect.TypeOf((*DisconnectNvmeControllerExRequestType)(nil)).Elem() +} + +type DisconnectNvmeControllerEx_Task DisconnectNvmeControllerExRequestType + +func init() { + t["DisconnectNvmeControllerEx_Task"] = reflect.TypeOf((*DisconnectNvmeControllerEx_Task)(nil)).Elem() +} + +type DisconnectNvmeControllerEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type DisconnectNvmeControllerRequestType struct { + This ManagedObjectReference `xml:"_this"` + DisconnectSpec HostNvmeDisconnectSpec `xml:"disconnectSpec"` +} + +func init() { + t["DisconnectNvmeControllerRequestType"] = reflect.TypeOf((*DisconnectNvmeControllerRequestType)(nil)).Elem() +} + +type DisconnectNvmeControllerResponse struct { +} + type DisconnectedHostsBlockingEVC struct { EVCConfigFault } @@ -13816,6 +15089,25 @@ func init() { type DiscoverFcoeHbasResponse struct { } +type DiscoverNvmeControllers DiscoverNvmeControllersRequestType + +func init() { + t["DiscoverNvmeControllers"] = reflect.TypeOf((*DiscoverNvmeControllers)(nil)).Elem() +} + +type DiscoverNvmeControllersRequestType struct { + This ManagedObjectReference `xml:"_this"` + DiscoverSpec HostNvmeDiscoverSpec `xml:"discoverSpec"` +} + +func init() { + t["DiscoverNvmeControllersRequestType"] = reflect.TypeOf((*DiscoverNvmeControllersRequestType)(nil)).Elem() +} + +type DiscoverNvmeControllersResponse struct { + Returnval HostNvmeDiscoveryLog `xml:"returnval"` +} + type DiskChangeExtent struct { DynamicData @@ -13839,6 +15131,17 @@ func init() { t["DiskChangeInfo"] = reflect.TypeOf((*DiskChangeInfo)(nil)).Elem() } +type DiskCryptoSpec struct { + DynamicData + + Parent *DiskCryptoSpec `xml:"parent,omitempty"` + Crypto BaseCryptoSpec `xml:"crypto,typeattr"` +} + +func init() { + t["DiskCryptoSpec"] = reflect.TypeOf((*DiskCryptoSpec)(nil)).Elem() +} + type DiskHasPartitions struct { VsanDiskFault } @@ -13972,6 +15275,8 @@ type DistributedVirtualPort struct { ConnectionCookie int32 `xml:"connectionCookie,omitempty"` LastStatusChange time.Time `xml:"lastStatusChange"` HostLocalPort *bool `xml:"hostLocalPort"` + ExternalId string `xml:"externalId,omitempty"` + SegmentPortId string `xml:"segmentPortId,omitempty"` } func init() { @@ -13989,12 +15294,37 @@ type DistributedVirtualPortgroupInfo struct { UplinkPortgroup bool `xml:"uplinkPortgroup"` Portgroup ManagedObjectReference `xml:"portgroup"` NetworkReservationSupported *bool `xml:"networkReservationSupported"` + BackingType string `xml:"backingType,omitempty"` + LogicalSwitchUuid string `xml:"logicalSwitchUuid,omitempty"` + SegmentId string `xml:"segmentId,omitempty"` } func init() { t["DistributedVirtualPortgroupInfo"] = reflect.TypeOf((*DistributedVirtualPortgroupInfo)(nil)).Elem() } +type DistributedVirtualPortgroupNsxPortgroupOperationResult struct { + DynamicData + + Portgroups []ManagedObjectReference `xml:"portgroups,omitempty"` + Problems []DistributedVirtualPortgroupProblem `xml:"problems,omitempty"` +} + +func init() { + t["DistributedVirtualPortgroupNsxPortgroupOperationResult"] = reflect.TypeOf((*DistributedVirtualPortgroupNsxPortgroupOperationResult)(nil)).Elem() +} + +type DistributedVirtualPortgroupProblem struct { + DynamicData + + LogicalSwitchUuid string `xml:"logicalSwitchUuid"` + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["DistributedVirtualPortgroupProblem"] = reflect.TypeOf((*DistributedVirtualPortgroupProblem)(nil)).Elem() +} + type DistributedVirtualSwitchHostMember struct { DynamicData @@ -14021,10 +15351,16 @@ func init() { type DistributedVirtualSwitchHostMemberConfigInfo struct { DynamicData - Host *ManagedObjectReference `xml:"host,omitempty"` - MaxProxySwitchPorts int32 `xml:"maxProxySwitchPorts"` - VendorSpecificConfig []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificConfig,omitempty"` - Backing BaseDistributedVirtualSwitchHostMemberBacking `xml:"backing,typeattr"` + Host *ManagedObjectReference `xml:"host,omitempty"` + MaxProxySwitchPorts int32 `xml:"maxProxySwitchPorts"` + VendorSpecificConfig []DistributedVirtualSwitchKeyedOpaqueBlob `xml:"vendorSpecificConfig,omitempty"` + Backing BaseDistributedVirtualSwitchHostMemberBacking `xml:"backing,typeattr"` + NsxSwitch *bool `xml:"nsxSwitch"` + EnsEnabled *bool `xml:"ensEnabled"` + EnsInterruptEnabled *bool `xml:"ensInterruptEnabled"` + TransportZones []DistributedVirtualSwitchHostMemberTransportZoneInfo `xml:"transportZones,omitempty"` + NsxtUsedUplinkNames []string `xml:"nsxtUsedUplinkNames,omitempty"` + NetworkOffloadingEnabled *bool `xml:"networkOffloadingEnabled"` } func init() { @@ -14078,6 +15414,17 @@ func init() { t["DistributedVirtualSwitchHostMemberRuntimeState"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberRuntimeState)(nil)).Elem() } +type DistributedVirtualSwitchHostMemberTransportZoneInfo struct { + DynamicData + + Uuid string `xml:"uuid"` + Type string `xml:"type"` +} + +func init() { + t["DistributedVirtualSwitchHostMemberTransportZoneInfo"] = reflect.TypeOf((*DistributedVirtualSwitchHostMemberTransportZoneInfo)(nil)).Elem() +} + type DistributedVirtualSwitchHostProductSpec struct { DynamicData @@ -14198,6 +15545,18 @@ func init() { t["DistributedVirtualSwitchManagerImportResult"] = reflect.TypeOf((*DistributedVirtualSwitchManagerImportResult)(nil)).Elem() } +type DistributedVirtualSwitchNetworkOffloadSpec struct { + DynamicData + + Id string `xml:"id"` + Name string `xml:"name,omitempty"` + Types []string `xml:"types,omitempty"` +} + +func init() { + t["DistributedVirtualSwitchNetworkOffloadSpec"] = reflect.TypeOf((*DistributedVirtualSwitchNetworkOffloadSpec)(nil)).Elem() +} + type DistributedVirtualSwitchPortConnectee struct { DynamicData @@ -14230,6 +15589,7 @@ type DistributedVirtualSwitchPortCriteria struct { Connected *bool `xml:"connected"` Active *bool `xml:"active"` UplinkPort *bool `xml:"uplinkPort"` + NsxPort *bool `xml:"nsxPort"` Scope *ManagedObjectReference `xml:"scope,omitempty"` PortgroupKey []string `xml:"portgroupKey,omitempty"` Inside *bool `xml:"inside"` @@ -14319,6 +15679,69 @@ func init() { t["DomainNotFoundFault"] = reflect.TypeOf((*DomainNotFoundFault)(nil)).Elem() } +type DownloadDescriptionTree DownloadDescriptionTreeRequestType + +func init() { + t["DownloadDescriptionTree"] = reflect.TypeOf((*DownloadDescriptionTree)(nil)).Elem() +} + +type DownloadDescriptionTreeRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["DownloadDescriptionTreeRequestType"] = reflect.TypeOf((*DownloadDescriptionTreeRequestType)(nil)).Elem() +} + +type DownloadDescriptionTreeResponse struct { + Returnval []byte `xml:"returnval"` +} + +type DpuStatusInfo struct { + HostHardwareElementInfo + + DpuId string `xml:"dpuId"` + Fru *HostFru `xml:"fru,omitempty"` + Sensors []DpuStatusInfoOperationalInfo `xml:"sensors,omitempty"` +} + +func init() { + t["DpuStatusInfo"] = reflect.TypeOf((*DpuStatusInfo)(nil)).Elem() +} + +type DpuStatusInfoOperationalInfo struct { + DynamicData + + SensorId string `xml:"sensorId"` + HealthState BaseElementDescription `xml:"healthState,omitempty,typeattr"` + Reading string `xml:"reading"` + Units string `xml:"units,omitempty"` + TimeStamp *time.Time `xml:"timeStamp"` +} + +func init() { + t["DpuStatusInfoOperationalInfo"] = reflect.TypeOf((*DpuStatusInfoOperationalInfo)(nil)).Elem() +} + +type DropConnections DropConnectionsRequestType + +func init() { + t["DropConnections"] = reflect.TypeOf((*DropConnections)(nil)).Elem() +} + +type DropConnectionsRequestType struct { + This ManagedObjectReference `xml:"_this"` + ListOfConnections []BaseVirtualMachineConnection `xml:"listOfConnections,omitempty,typeattr"` +} + +func init() { + t["DropConnectionsRequestType"] = reflect.TypeOf((*DropConnectionsRequestType)(nil)).Elem() +} + +type DropConnectionsResponse struct { + Returnval bool `xml:"returnval"` +} + type DrsDisabledEvent struct { ClusterEvent } @@ -15774,6 +17197,12 @@ func init() { t["ElementDescription"] = reflect.TypeOf((*ElementDescription)(nil)).Elem() } +type EnableAlarm EnableAlarmRequestType + +func init() { + t["EnableAlarm"] = reflect.TypeOf((*EnableAlarm)(nil)).Elem() +} + type EnableAlarmActions EnableAlarmActionsRequestType func init() { @@ -15793,6 +17222,37 @@ func init() { type EnableAlarmActionsResponse struct { } +type EnableAlarmRequestType struct { + This ManagedObjectReference `xml:"_this"` + Alarm ManagedObjectReference `xml:"alarm"` + Entity ManagedObjectReference `xml:"entity"` +} + +func init() { + t["EnableAlarmRequestType"] = reflect.TypeOf((*EnableAlarmRequestType)(nil)).Elem() +} + +type EnableAlarmResponse struct { +} + +type EnableClusteredVmdkSupport EnableClusteredVmdkSupportRequestType + +func init() { + t["EnableClusteredVmdkSupport"] = reflect.TypeOf((*EnableClusteredVmdkSupport)(nil)).Elem() +} + +type EnableClusteredVmdkSupportRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datastore ManagedObjectReference `xml:"datastore"` +} + +func init() { + t["EnableClusteredVmdkSupportRequestType"] = reflect.TypeOf((*EnableClusteredVmdkSupportRequestType)(nil)).Elem() +} + +type EnableClusteredVmdkSupportResponse struct { +} + type EnableCrypto EnableCryptoRequestType func init() { @@ -16724,6 +18184,26 @@ type ExtendDisk_TaskResponse struct { Returnval ManagedObjectReference `xml:"returnval"` } +type ExtendHCIRequestType struct { + This ManagedObjectReference `xml:"_this"` + HostInputs []ClusterComputeResourceHostConfigurationInput `xml:"hostInputs,omitempty"` + VSanConfigSpec *SDDCBase `xml:"vSanConfigSpec,omitempty"` +} + +func init() { + t["ExtendHCIRequestType"] = reflect.TypeOf((*ExtendHCIRequestType)(nil)).Elem() +} + +type ExtendHCI_Task ExtendHCIRequestType + +func init() { + t["ExtendHCI_Task"] = reflect.TypeOf((*ExtendHCI_Task)(nil)).Elem() +} + +type ExtendHCI_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + type ExtendVffs ExtendVffsRequestType func init() { @@ -17400,6 +18880,18 @@ func init() { t["FcoeFaultPnicHasNoPortSetFault"] = reflect.TypeOf((*FcoeFaultPnicHasNoPortSetFault)(nil)).Elem() } +type FeatureEVCMode struct { + ElementDescription + + Mask []HostFeatureMask `xml:"mask,omitempty"` + Capability []HostFeatureCapability `xml:"capability,omitempty"` + Requirement []VirtualMachineFeatureRequirement `xml:"requirement,omitempty"` +} + +func init() { + t["FeatureEVCMode"] = reflect.TypeOf((*FeatureEVCMode)(nil)).Elem() +} + type FeatureRequirementsNotMet struct { VirtualHardwareCompatibilityIssue @@ -17418,6 +18910,25 @@ func init() { t["FeatureRequirementsNotMetFault"] = reflect.TypeOf((*FeatureRequirementsNotMetFault)(nil)).Elem() } +type FetchAuditRecords FetchAuditRecordsRequestType + +func init() { + t["FetchAuditRecords"] = reflect.TypeOf((*FetchAuditRecords)(nil)).Elem() +} + +type FetchAuditRecordsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Token string `xml:"token,omitempty"` +} + +func init() { + t["FetchAuditRecordsRequestType"] = reflect.TypeOf((*FetchAuditRecordsRequestType)(nil)).Elem() +} + +type FetchAuditRecordsResponse struct { + Returnval DiagnosticManagerAuditRecordResult `xml:"returnval"` +} + type FetchDVPortKeys FetchDVPortKeysRequestType func init() { @@ -17993,6 +19504,29 @@ func init() { t["FloppyImageFileQuery"] = reflect.TypeOf((*FloppyImageFileQuery)(nil)).Elem() } +type FolderBatchAddHostsToClusterResult struct { + DynamicData + + HostsAddedToCluster []ManagedObjectReference `xml:"hostsAddedToCluster,omitempty"` + HostsFailedInventoryAdd []FolderFailedHostResult `xml:"hostsFailedInventoryAdd,omitempty"` + HostsFailedMoveToCluster []FolderFailedHostResult `xml:"hostsFailedMoveToCluster,omitempty"` +} + +func init() { + t["FolderBatchAddHostsToClusterResult"] = reflect.TypeOf((*FolderBatchAddHostsToClusterResult)(nil)).Elem() +} + +type FolderBatchAddStandaloneHostsResult struct { + DynamicData + + AddedHosts []ManagedObjectReference `xml:"addedHosts,omitempty"` + HostsFailedInventoryAdd []FolderFailedHostResult `xml:"hostsFailedInventoryAdd,omitempty"` +} + +func init() { + t["FolderBatchAddStandaloneHostsResult"] = reflect.TypeOf((*FolderBatchAddStandaloneHostsResult)(nil)).Elem() +} + type FolderEventArgument struct { EntityEventArgument @@ -18003,6 +19537,19 @@ func init() { t["FolderEventArgument"] = reflect.TypeOf((*FolderEventArgument)(nil)).Elem() } +type FolderFailedHostResult struct { + DynamicData + + HostName string `xml:"hostName,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` + Context LocalizableMessage `xml:"context"` + Fault LocalizedMethodFault `xml:"fault"` +} + +func init() { + t["FolderFailedHostResult"] = reflect.TypeOf((*FolderFailedHostResult)(nil)).Elem() +} + type FolderFileInfo struct { FileInfo } @@ -18019,6 +19566,17 @@ func init() { t["FolderFileQuery"] = reflect.TypeOf((*FolderFileQuery)(nil)).Elem() } +type FolderNewHostSpec struct { + DynamicData + + HostCnxSpec HostConnectSpec `xml:"hostCnxSpec"` + EsxLicense string `xml:"esxLicense,omitempty"` +} + +func init() { + t["FolderNewHostSpec"] = reflect.TypeOf((*FolderNewHostSpec)(nil)).Elem() +} + type FormatVffs FormatVffsRequestType func init() { @@ -18546,6 +20104,26 @@ type GetCustomizationSpecResponse struct { Returnval CustomizationSpecItem `xml:"returnval"` } +type GetDefaultKmsCluster GetDefaultKmsClusterRequestType + +func init() { + t["GetDefaultKmsCluster"] = reflect.TypeOf((*GetDefaultKmsCluster)(nil)).Elem() +} + +type GetDefaultKmsClusterRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity *ManagedObjectReference `xml:"entity,omitempty"` + DefaultsToParent *bool `xml:"defaultsToParent"` +} + +func init() { + t["GetDefaultKmsClusterRequestType"] = reflect.TypeOf((*GetDefaultKmsClusterRequestType)(nil)).Elem() +} + +type GetDefaultKmsClusterResponse struct { + Returnval *KeyProviderId `xml:"returnval,omitempty"` +} + type GetPublicKey GetPublicKeyRequestType func init() { @@ -18582,6 +20160,42 @@ type GetResourceUsageResponse struct { Returnval ClusterResourceUsageSummary `xml:"returnval"` } +type GetSiteInfo GetSiteInfoRequestType + +func init() { + t["GetSiteInfo"] = reflect.TypeOf((*GetSiteInfo)(nil)).Elem() +} + +type GetSiteInfoRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["GetSiteInfoRequestType"] = reflect.TypeOf((*GetSiteInfoRequestType)(nil)).Elem() +} + +type GetSiteInfoResponse struct { + Returnval SiteInfo `xml:"returnval"` +} + +type GetSystemVMsRestrictedDatastores GetSystemVMsRestrictedDatastoresRequestType + +func init() { + t["GetSystemVMsRestrictedDatastores"] = reflect.TypeOf((*GetSystemVMsRestrictedDatastores)(nil)).Elem() +} + +type GetSystemVMsRestrictedDatastoresRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["GetSystemVMsRestrictedDatastoresRequestType"] = reflect.TypeOf((*GetSystemVMsRestrictedDatastoresRequestType)(nil)).Elem() +} + +type GetSystemVMsRestrictedDatastoresResponse struct { + Returnval []ManagedObjectReference `xml:"returnval,omitempty"` +} + type GetVchaClusterHealth GetVchaClusterHealthRequestType func init() { @@ -18752,9 +20366,11 @@ func init() { type GuestDiskInfo struct { DynamicData - DiskPath string `xml:"diskPath,omitempty"` - Capacity int64 `xml:"capacity,omitempty"` - FreeSpace int64 `xml:"freeSpace,omitempty"` + DiskPath string `xml:"diskPath,omitempty"` + Capacity int64 `xml:"capacity,omitempty"` + FreeSpace int64 `xml:"freeSpace,omitempty"` + FilesystemType string `xml:"filesystemType,omitempty"` + Mappings []GuestInfoVirtualDiskMapping `xml:"mappings,omitempty"` } func init() { @@ -18812,12 +20428,27 @@ type GuestInfo struct { InteractiveGuestOperationsReady *bool `xml:"interactiveGuestOperationsReady"` GuestStateChangeSupported *bool `xml:"guestStateChangeSupported"` GenerationInfo []GuestInfoNamespaceGenerationInfo `xml:"generationInfo,omitempty"` + HwVersion string `xml:"hwVersion,omitempty"` + CustomizationInfo *GuestInfoCustomizationInfo `xml:"customizationInfo,omitempty"` } func init() { t["GuestInfo"] = reflect.TypeOf((*GuestInfo)(nil)).Elem() } +type GuestInfoCustomizationInfo struct { + DynamicData + + CustomizationStatus string `xml:"customizationStatus"` + StartTime *time.Time `xml:"startTime"` + EndTime *time.Time `xml:"endTime"` + ErrorMsg string `xml:"errorMsg,omitempty"` +} + +func init() { + t["GuestInfoCustomizationInfo"] = reflect.TypeOf((*GuestInfoCustomizationInfo)(nil)).Elem() +} + type GuestInfoNamespaceGenerationInfo struct { DynamicData @@ -18829,6 +20460,16 @@ func init() { t["GuestInfoNamespaceGenerationInfo"] = reflect.TypeOf((*GuestInfoNamespaceGenerationInfo)(nil)).Elem() } +type GuestInfoVirtualDiskMapping struct { + DynamicData + + Key int32 `xml:"key"` +} + +func init() { + t["GuestInfoVirtualDiskMapping"] = reflect.TypeOf((*GuestInfoVirtualDiskMapping)(nil)).Elem() +} + type GuestListFileInfo struct { DynamicData @@ -18973,7 +20614,11 @@ type GuestOsDescriptor struct { NumRecommendedCoresPerSocket int32 `xml:"numRecommendedCoresPerSocket,omitempty"` VvtdSupported *BoolOption `xml:"vvtdSupported,omitempty"` VbsSupported *BoolOption `xml:"vbsSupported,omitempty"` + VsgxSupported *BoolOption `xml:"vsgxSupported,omitempty"` + VsgxRemoteAttestationSupported *bool `xml:"vsgxRemoteAttestationSupported"` SupportsTPM20 *bool `xml:"supportsTPM20"` + RecommendedTPM20 *bool `xml:"recommendedTPM20"` + VwdtSupported *bool `xml:"vwdtSupported"` } func init() { @@ -19704,6 +21349,39 @@ func init() { t["HostApplyProfile"] = reflect.TypeOf((*HostApplyProfile)(nil)).Elem() } +type HostAssignableHardwareBinding struct { + DynamicData + + InstanceId string `xml:"instanceId"` + Vm ManagedObjectReference `xml:"vm"` +} + +func init() { + t["HostAssignableHardwareBinding"] = reflect.TypeOf((*HostAssignableHardwareBinding)(nil)).Elem() +} + +type HostAssignableHardwareConfig struct { + DynamicData + + AttributeOverride []HostAssignableHardwareConfigAttributeOverride `xml:"attributeOverride,omitempty"` +} + +func init() { + t["HostAssignableHardwareConfig"] = reflect.TypeOf((*HostAssignableHardwareConfig)(nil)).Elem() +} + +type HostAssignableHardwareConfigAttributeOverride struct { + DynamicData + + InstanceId string `xml:"instanceId"` + Name string `xml:"name"` + Value AnyType `xml:"value,typeattr"` +} + +func init() { + t["HostAssignableHardwareConfigAttributeOverride"] = reflect.TypeOf((*HostAssignableHardwareConfigAttributeOverride)(nil)).Elem() +} + type HostAuthenticationManagerInfo struct { DynamicData @@ -19925,6 +21603,34 @@ type HostCapability struct { VmCreateDateSupported *bool `xml:"vmCreateDateSupported"` Vmfs3EOLSupported *bool `xml:"vmfs3EOLSupported"` FtVmcpSupported *bool `xml:"ftVmcpSupported"` + QuickBootSupported *bool `xml:"quickBootSupported"` + EncryptedFtSupported *bool `xml:"encryptedFtSupported"` + AssignableHardwareSupported *bool `xml:"assignableHardwareSupported"` + SuspendToMemorySupported *bool `xml:"suspendToMemorySupported"` + UseFeatureReqsForOldHWv *bool `xml:"useFeatureReqsForOldHWv"` + MarkPerenniallyReservedSupported *bool `xml:"markPerenniallyReservedSupported"` + HppPspSupported *bool `xml:"hppPspSupported"` + DeviceRebindWithoutRebootSupported *bool `xml:"deviceRebindWithoutRebootSupported"` + StoragePolicyChangeSupported *bool `xml:"storagePolicyChangeSupported"` + PrecisionTimeProtocolSupported *bool `xml:"precisionTimeProtocolSupported"` + RemoteDeviceVMotionSupported *bool `xml:"remoteDeviceVMotionSupported"` + MaxSupportedVmMemory int32 `xml:"maxSupportedVmMemory,omitempty"` + AhDeviceHintsSupported *bool `xml:"ahDeviceHintsSupported"` + NvmeOverTcpSupported *bool `xml:"nvmeOverTcpSupported"` + NvmeStorageFabricServicesSupported *bool `xml:"nvmeStorageFabricServicesSupported"` + AssignHwPciConfigSupported *bool `xml:"assignHwPciConfigSupported"` + TimeConfigSupported *bool `xml:"timeConfigSupported"` + NvmeBatchOperationsSupported *bool `xml:"nvmeBatchOperationsSupported"` + PMemFailoverSupported *bool `xml:"pMemFailoverSupported"` + HostConfigEncryptionSupported *bool `xml:"hostConfigEncryptionSupported"` + MaxSupportedSimultaneousThreads int32 `xml:"maxSupportedSimultaneousThreads,omitempty"` + PtpConfigSupported *bool `xml:"ptpConfigSupported"` + MaxSupportedPtpPorts int32 `xml:"maxSupportedPtpPorts,omitempty"` + SgxRegistrationSupported *bool `xml:"sgxRegistrationSupported"` + PMemIndependentSnapshotSupported *bool `xml:"pMemIndependentSnapshotSupported"` + IommuSLDirtyCapable *bool `xml:"iommuSLDirtyCapable"` + UltralowFixedUnmapSupported *bool `xml:"ultralowFixedUnmapSupported"` + NvmeVvolSupported *bool `xml:"nvmeVvolSupported"` } func init() { @@ -20221,12 +21927,15 @@ type HostConfigInfo struct { DomainList []string `xml:"domainList,omitempty"` ScriptCheckSum []byte `xml:"scriptCheckSum,omitempty"` HostConfigCheckSum []byte `xml:"hostConfigCheckSum,omitempty"` + DescriptionTreeCheckSum []byte `xml:"descriptionTreeCheckSum,omitempty"` GraphicsInfo []HostGraphicsInfo `xml:"graphicsInfo,omitempty"` SharedPassthruGpuTypes []string `xml:"sharedPassthruGpuTypes,omitempty"` GraphicsConfig *HostGraphicsConfig `xml:"graphicsConfig,omitempty"` SharedGpuCapabilities []HostSharedGpuCapabilities `xml:"sharedGpuCapabilities,omitempty"` IoFilterInfo []HostIoFilterInfo `xml:"ioFilterInfo,omitempty"` SriovDevicePool []BaseHostSriovDevicePoolInfo `xml:"sriovDevicePool,omitempty,typeattr"` + AssignableHardwareBinding []HostAssignableHardwareBinding `xml:"assignableHardwareBinding,omitempty"` + AssignableHardwareConfig *HostAssignableHardwareConfig `xml:"assignableHardwareConfig,omitempty"` } func init() { @@ -20274,6 +21983,7 @@ type HostConfigManager struct { CertificateManager *ManagedObjectReference `xml:"certificateManager,omitempty"` CryptoManager *ManagedObjectReference `xml:"cryptoManager,omitempty"` NvdimmSystem *ManagedObjectReference `xml:"nvdimmSystem,omitempty"` + AssignableHardwareManager *ManagedObjectReference `xml:"assignableHardwareManager,omitempty"` } func init() { @@ -20301,6 +22011,7 @@ type HostConfigSpec struct { ActiveDirectory []HostActiveDirectory `xml:"activeDirectory,omitempty"` GenericConfig []KeyAnyValue `xml:"genericConfig,omitempty"` GraphicsConfig *HostGraphicsConfig `xml:"graphicsConfig,omitempty"` + AssignableHardwareConfig *HostAssignableHardwareConfig `xml:"assignableHardwareConfig,omitempty"` } func init() { @@ -20574,6 +22285,16 @@ func init() { t["HostDasOkEvent"] = reflect.TypeOf((*HostDasOkEvent)(nil)).Elem() } +type HostDataTransportConnectionInfo struct { + DynamicData + + StaticMemoryConsumed int64 `xml:"staticMemoryConsumed"` +} + +func init() { + t["HostDataTransportConnectionInfo"] = reflect.TypeOf((*HostDataTransportConnectionInfo)(nil)).Elem() +} + type HostDatastoreBrowserSearchResults struct { DynamicData @@ -20668,8 +22389,14 @@ func init() { type HostDateTimeConfig struct { DynamicData - TimeZone string `xml:"timeZone,omitempty"` - NtpConfig *HostNtpConfig `xml:"ntpConfig,omitempty"` + TimeZone string `xml:"timeZone,omitempty"` + NtpConfig *HostNtpConfig `xml:"ntpConfig,omitempty"` + PtpConfig *HostPtpConfig `xml:"ptpConfig,omitempty"` + Protocol string `xml:"protocol,omitempty"` + Enabled *bool `xml:"enabled"` + DisableEvents *bool `xml:"disableEvents"` + DisableFallback *bool `xml:"disableFallback"` + ResetToFactoryDefaults *bool `xml:"resetToFactoryDefaults"` } func init() { @@ -20679,14 +22406,38 @@ func init() { type HostDateTimeInfo struct { DynamicData - TimeZone HostDateTimeSystemTimeZone `xml:"timeZone"` - NtpConfig *HostNtpConfig `xml:"ntpConfig,omitempty"` + TimeZone HostDateTimeSystemTimeZone `xml:"timeZone"` + SystemClockProtocol string `xml:"systemClockProtocol,omitempty"` + NtpConfig *HostNtpConfig `xml:"ntpConfig,omitempty"` + PtpConfig *HostPtpConfig `xml:"ptpConfig,omitempty"` + Enabled *bool `xml:"enabled"` + DisableEvents *bool `xml:"disableEvents"` + DisableFallback *bool `xml:"disableFallback"` + InFallbackState *bool `xml:"inFallbackState"` + ServiceSync *bool `xml:"serviceSync"` + LastSyncTime *time.Time `xml:"lastSyncTime"` + RemoteNtpServer string `xml:"remoteNtpServer,omitempty"` + NtpRunTime int64 `xml:"ntpRunTime,omitempty"` + PtpRunTime int64 `xml:"ptpRunTime,omitempty"` + NtpDuration string `xml:"ntpDuration,omitempty"` + PtpDuration string `xml:"ptpDuration,omitempty"` } func init() { t["HostDateTimeInfo"] = reflect.TypeOf((*HostDateTimeInfo)(nil)).Elem() } +type HostDateTimeSystemServiceTestResult struct { + DynamicData + + WorkingNormally bool `xml:"workingNormally"` + Report []string `xml:"report,omitempty"` +} + +func init() { + t["HostDateTimeSystemServiceTestResult"] = reflect.TypeOf((*HostDateTimeSystemServiceTestResult)(nil)).Elem() +} + type HostDateTimeSystemTimeZone struct { DynamicData @@ -20700,6 +22451,26 @@ func init() { t["HostDateTimeSystemTimeZone"] = reflect.TypeOf((*HostDateTimeSystemTimeZone)(nil)).Elem() } +type HostDeleteVStorageObjectExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` +} + +func init() { + t["HostDeleteVStorageObjectExRequestType"] = reflect.TypeOf((*HostDeleteVStorageObjectExRequestType)(nil)).Elem() +} + +type HostDeleteVStorageObjectEx_Task HostDeleteVStorageObjectExRequestType + +func init() { + t["HostDeleteVStorageObjectEx_Task"] = reflect.TypeOf((*HostDeleteVStorageObjectEx_Task)(nil)).Elem() +} + +type HostDeleteVStorageObjectEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + type HostDeleteVStorageObjectRequestType struct { This ManagedObjectReference `xml:"_this"` Id ID `xml:"id"` @@ -21045,6 +22816,19 @@ func init() { t["HostDnsConfigSpec"] = reflect.TypeOf((*HostDnsConfigSpec)(nil)).Elem() } +type HostDvxClass struct { + DynamicData + + DeviceClass string `xml:"deviceClass"` + CheckpointSupported bool `xml:"checkpointSupported"` + SwDMATracingSupported bool `xml:"swDMATracingSupported"` + SriovNic bool `xml:"sriovNic"` +} + +func init() { + t["HostDvxClass"] = reflect.TypeOf((*HostDvxClass)(nil)).Elem() +} + type HostEnableAdminFailedEvent struct { HostEvent @@ -21191,7 +22975,7 @@ type HostFibreChannelOverEthernetHba struct { UnderlyingNic string `xml:"underlyingNic"` LinkInfo HostFibreChannelOverEthernetHbaLinkInfo `xml:"linkInfo"` IsSoftwareFcoe bool `xml:"isSoftwareFcoe"` - MarkedForRemoval bool `xml:"markedForRemoval"` + MarkedForRemoval *bool `xml:"markedForRemoval"` } func init() { @@ -21408,6 +23192,21 @@ func init() { t["HostForceMountedInfo"] = reflect.TypeOf((*HostForceMountedInfo)(nil)).Elem() } +type HostFru struct { + DynamicData + + Type string `xml:"type"` + PartName string `xml:"partName"` + PartNumber string `xml:"partNumber"` + Manufacturer string `xml:"manufacturer"` + SerialNumber string `xml:"serialNumber,omitempty"` + MfgTimeStamp *time.Time `xml:"mfgTimeStamp"` +} + +func init() { + t["HostFru"] = reflect.TypeOf((*HostFru)(nil)).Elem() +} + type HostGatewaySpec struct { DynamicData @@ -21508,10 +23307,15 @@ type HostHardwareInfo struct { NumaInfo *HostNumaInfo `xml:"numaInfo,omitempty"` SmcPresent *bool `xml:"smcPresent"` PciDevice []HostPciDevice `xml:"pciDevice,omitempty"` + DvxClasses []HostDvxClass `xml:"dvxClasses,omitempty"` CpuFeature []HostCpuIdInfo `xml:"cpuFeature,omitempty"` BiosInfo *HostBIOSInfo `xml:"biosInfo,omitempty"` ReliableMemoryInfo *HostReliableMemoryInfo `xml:"reliableMemoryInfo,omitempty"` PersistentMemoryInfo *HostPersistentMemoryInfo `xml:"persistentMemoryInfo,omitempty"` + SgxInfo *HostSgxInfo `xml:"sgxInfo,omitempty"` + SevInfo *HostSevInfo `xml:"sevInfo,omitempty"` + MemoryTieringType string `xml:"memoryTieringType,omitempty"` + MemoryTierInfo []HostMemoryTierInfo `xml:"memoryTierInfo,omitempty"` } func init() { @@ -21524,6 +23328,7 @@ type HostHardwareStatusInfo struct { MemoryStatusInfo []BaseHostHardwareElementInfo `xml:"memoryStatusInfo,omitempty,typeattr"` CpuStatusInfo []BaseHostHardwareElementInfo `xml:"cpuStatusInfo,omitempty,typeattr"` StorageStatusInfo []HostStorageElementInfo `xml:"storageStatusInfo,omitempty"` + DpuStatusInfo []DpuStatusInfo `xml:"dpuStatusInfo,omitempty"` } func init() { @@ -21569,16 +23374,25 @@ func init() { t["HostHasComponentFailureFault"] = reflect.TypeOf((*HostHasComponentFailureFault)(nil)).Elem() } +type HostHbaCreateSpec struct { + DynamicData +} + +func init() { + t["HostHbaCreateSpec"] = reflect.TypeOf((*HostHbaCreateSpec)(nil)).Elem() +} + type HostHostBusAdapter struct { DynamicData - Key string `xml:"key,omitempty"` - Device string `xml:"device"` - Bus int32 `xml:"bus"` - Status string `xml:"status"` - Model string `xml:"model"` - Driver string `xml:"driver,omitempty"` - Pci string `xml:"pci,omitempty"` + Key string `xml:"key,omitempty"` + Device string `xml:"device"` + Bus int32 `xml:"bus"` + Status string `xml:"status"` + Model string `xml:"model"` + Driver string `xml:"driver,omitempty"` + Pci string `xml:"pci,omitempty"` + StorageProtocol string `xml:"storageProtocol,omitempty"` } func init() { @@ -22239,19 +24053,21 @@ func init() { type HostListSummary struct { DynamicData - Host *ManagedObjectReference `xml:"host,omitempty"` - Hardware *HostHardwareSummary `xml:"hardware,omitempty"` - Runtime *HostRuntimeInfo `xml:"runtime,omitempty"` - Config HostConfigSummary `xml:"config"` - QuickStats HostListSummaryQuickStats `xml:"quickStats"` - OverallStatus ManagedEntityStatus `xml:"overallStatus"` - RebootRequired bool `xml:"rebootRequired"` - CustomValue []BaseCustomFieldValue `xml:"customValue,omitempty,typeattr"` - ManagementServerIp string `xml:"managementServerIp,omitempty"` - MaxEVCModeKey string `xml:"maxEVCModeKey,omitempty"` - CurrentEVCModeKey string `xml:"currentEVCModeKey,omitempty"` - Gateway *HostListSummaryGatewaySummary `xml:"gateway,omitempty"` - TpmAttestation *HostTpmAttestationInfo `xml:"tpmAttestation,omitempty"` + Host *ManagedObjectReference `xml:"host,omitempty"` + Hardware *HostHardwareSummary `xml:"hardware,omitempty"` + Runtime *HostRuntimeInfo `xml:"runtime,omitempty"` + Config HostConfigSummary `xml:"config"` + QuickStats HostListSummaryQuickStats `xml:"quickStats"` + OverallStatus ManagedEntityStatus `xml:"overallStatus"` + RebootRequired bool `xml:"rebootRequired"` + CustomValue []BaseCustomFieldValue `xml:"customValue,omitempty,typeattr"` + ManagementServerIp string `xml:"managementServerIp,omitempty"` + MaxEVCModeKey string `xml:"maxEVCModeKey,omitempty"` + CurrentEVCModeKey string `xml:"currentEVCModeKey,omitempty"` + CurrentEVCGraphicsModeKey string `xml:"currentEVCGraphicsModeKey,omitempty"` + Gateway *HostListSummaryGatewaySummary `xml:"gateway,omitempty"` + TpmAttestation *HostTpmAttestationInfo `xml:"tpmAttestation,omitempty"` + TrustAuthorityAttestationInfos []HostTrustAuthorityAttestationInfo `xml:"trustAuthorityAttestationInfos,omitempty"` } func init() { @@ -22446,6 +24262,7 @@ type HostMaintenanceSpec struct { DynamicData VsanMode *VsanHostDecommissionMode `xml:"vsanMode,omitempty"` + Purpose string `xml:"purpose,omitempty"` } func init() { @@ -22468,6 +24285,8 @@ type HostMemberRuntimeInfo struct { Host ManagedObjectReference `xml:"host"` Status string `xml:"status,omitempty"` StatusDetail string `xml:"statusDetail,omitempty"` + NsxtStatus string `xml:"nsxtStatus,omitempty"` + NsxtStatusDetail string `xml:"nsxtStatusDetail,omitempty"` HealthCheckResult []BaseHostMemberHealthCheckResult `xml:"healthCheckResult,omitempty,typeattr"` } @@ -22503,6 +24322,19 @@ func init() { t["HostMemorySpec"] = reflect.TypeOf((*HostMemorySpec)(nil)).Elem() } +type HostMemoryTierInfo struct { + DynamicData + + Name string `xml:"name"` + Type string `xml:"type"` + Flags []string `xml:"flags,omitempty"` + Size int64 `xml:"size"` +} + +func init() { + t["HostMemoryTierInfo"] = reflect.TypeOf((*HostMemoryTierInfo)(nil)).Elem() +} + type HostMissingNetworksEvent struct { HostDasEvent @@ -22532,6 +24364,7 @@ type HostMountInfo struct { Mounted *bool `xml:"mounted"` Accessible *bool `xml:"accessible"` InaccessibleReason string `xml:"inaccessibleReason,omitempty"` + MountFailedReason string `xml:"mountFailedReason,omitempty"` } func init() { @@ -22558,6 +24391,20 @@ func init() { t["HostMultipathInfoFixedLogicalUnitPolicy"] = reflect.TypeOf((*HostMultipathInfoFixedLogicalUnitPolicy)(nil)).Elem() } +type HostMultipathInfoHppLogicalUnitPolicy struct { + HostMultipathInfoLogicalUnitPolicy + + Bytes int64 `xml:"bytes,omitempty"` + Iops int64 `xml:"iops,omitempty"` + Path string `xml:"path,omitempty"` + LatencyEvalTime int64 `xml:"latencyEvalTime,omitempty"` + SamplingIosPerPath int64 `xml:"samplingIosPerPath,omitempty"` +} + +func init() { + t["HostMultipathInfoHppLogicalUnitPolicy"] = reflect.TypeOf((*HostMultipathInfoHppLogicalUnitPolicy)(nil)).Elem() +} + type HostMultipathInfoLogicalUnit struct { DynamicData @@ -22772,6 +24619,7 @@ type HostNetCapabilities struct { DnsConfigSupported bool `xml:"dnsConfigSupported"` DhcpOnVnicSupported bool `xml:"dhcpOnVnicSupported"` IpV6Supported *bool `xml:"ipV6Supported"` + BackupNfcNiocSupported *bool `xml:"backupNfcNiocSupported"` } func init() { @@ -22824,6 +24672,7 @@ type HostNetworkConfig struct { Nat []HostNatServiceConfig `xml:"nat,omitempty"` IpV6Enabled *bool `xml:"ipV6Enabled"` NetStackSpec []HostNetworkConfigNetStackSpec `xml:"netStackSpec,omitempty"` + MigrationStatus string `xml:"migrationStatus,omitempty"` } func init() { @@ -22855,23 +24704,27 @@ func init() { type HostNetworkInfo struct { DynamicData - Vswitch []HostVirtualSwitch `xml:"vswitch,omitempty"` - ProxySwitch []HostProxySwitch `xml:"proxySwitch,omitempty"` - Portgroup []HostPortGroup `xml:"portgroup,omitempty"` - Pnic []PhysicalNic `xml:"pnic,omitempty"` - Vnic []HostVirtualNic `xml:"vnic,omitempty"` - ConsoleVnic []HostVirtualNic `xml:"consoleVnic,omitempty"` - DnsConfig BaseHostDnsConfig `xml:"dnsConfig,omitempty,typeattr"` - IpRouteConfig BaseHostIpRouteConfig `xml:"ipRouteConfig,omitempty,typeattr"` - ConsoleIpRouteConfig BaseHostIpRouteConfig `xml:"consoleIpRouteConfig,omitempty,typeattr"` - RouteTableInfo *HostIpRouteTableInfo `xml:"routeTableInfo,omitempty"` - Dhcp []HostDhcpService `xml:"dhcp,omitempty"` - Nat []HostNatService `xml:"nat,omitempty"` - IpV6Enabled *bool `xml:"ipV6Enabled"` - AtBootIpV6Enabled *bool `xml:"atBootIpV6Enabled"` - NetStackInstance []HostNetStackInstance `xml:"netStackInstance,omitempty"` - OpaqueSwitch []HostOpaqueSwitch `xml:"opaqueSwitch,omitempty"` - OpaqueNetwork []HostOpaqueNetworkInfo `xml:"opaqueNetwork,omitempty"` + Vswitch []HostVirtualSwitch `xml:"vswitch,omitempty"` + ProxySwitch []HostProxySwitch `xml:"proxySwitch,omitempty"` + Portgroup []HostPortGroup `xml:"portgroup,omitempty"` + Pnic []PhysicalNic `xml:"pnic,omitempty"` + RdmaDevice []HostRdmaDevice `xml:"rdmaDevice,omitempty"` + Vnic []HostVirtualNic `xml:"vnic,omitempty"` + ConsoleVnic []HostVirtualNic `xml:"consoleVnic,omitempty"` + DnsConfig BaseHostDnsConfig `xml:"dnsConfig,omitempty,typeattr"` + IpRouteConfig BaseHostIpRouteConfig `xml:"ipRouteConfig,omitempty,typeattr"` + ConsoleIpRouteConfig BaseHostIpRouteConfig `xml:"consoleIpRouteConfig,omitempty,typeattr"` + RouteTableInfo *HostIpRouteTableInfo `xml:"routeTableInfo,omitempty"` + Dhcp []HostDhcpService `xml:"dhcp,omitempty"` + Nat []HostNatService `xml:"nat,omitempty"` + IpV6Enabled *bool `xml:"ipV6Enabled"` + AtBootIpV6Enabled *bool `xml:"atBootIpV6Enabled"` + NetStackInstance []HostNetStackInstance `xml:"netStackInstance,omitempty"` + OpaqueSwitch []HostOpaqueSwitch `xml:"opaqueSwitch,omitempty"` + OpaqueNetwork []HostOpaqueNetworkInfo `xml:"opaqueNetwork,omitempty"` + NsxTransportNodeId string `xml:"nsxTransportNodeId,omitempty"` + NvdsToVdsMigrationRequired *bool `xml:"nvdsToVdsMigrationRequired"` + MigrationStatus string `xml:"migrationStatus,omitempty"` } func init() { @@ -22934,6 +24787,16 @@ func init() { t["HostNewNetworkConnectInfo"] = reflect.TypeOf((*HostNewNetworkConnectInfo)(nil)).Elem() } +type HostNfcConnectionInfo struct { + HostDataTransportConnectionInfo + + StreamingMemoryConsumed int64 `xml:"streamingMemoryConsumed,omitempty"` +} + +func init() { + t["HostNfcConnectionInfo"] = reflect.TypeOf((*HostNfcConnectionInfo)(nil)).Elem() +} + type HostNicFailureCriteria struct { DynamicData @@ -23074,6 +24937,7 @@ type HostNumaNode struct { TypeId byte `xml:"typeId"` CpuID []int16 `xml:"cpuID"` + MemorySize int64 `xml:"memorySize,omitempty"` MemoryRangeBegin int64 `xml:"memoryRangeBegin"` MemoryRangeLength int64 `xml:"memoryRangeLength"` PciId []string `xml:"pciId,omitempty"` @@ -23094,13 +24958,206 @@ type HostNumericSensorInfo struct { RateUnits string `xml:"rateUnits,omitempty"` SensorType string `xml:"sensorType"` Id string `xml:"id,omitempty"` + SensorNumber int64 `xml:"sensorNumber,omitempty"` TimeStamp string `xml:"timeStamp,omitempty"` + Fru *HostFru `xml:"fru,omitempty"` } func init() { t["HostNumericSensorInfo"] = reflect.TypeOf((*HostNumericSensorInfo)(nil)).Elem() } +type HostNvmeConnectSpec struct { + HostNvmeSpec + + Subnqn string `xml:"subnqn"` + ControllerId int32 `xml:"controllerId,omitempty"` + AdminQueueSize int32 `xml:"adminQueueSize,omitempty"` + KeepAliveTimeout int32 `xml:"keepAliveTimeout,omitempty"` +} + +func init() { + t["HostNvmeConnectSpec"] = reflect.TypeOf((*HostNvmeConnectSpec)(nil)).Elem() +} + +type HostNvmeController struct { + DynamicData + + Key string `xml:"key"` + ControllerNumber int32 `xml:"controllerNumber"` + Subnqn string `xml:"subnqn"` + Name string `xml:"name"` + AssociatedAdapter string `xml:"associatedAdapter"` + TransportType string `xml:"transportType"` + FusedOperationSupported bool `xml:"fusedOperationSupported"` + NumberOfQueues int32 `xml:"numberOfQueues"` + QueueSize int32 `xml:"queueSize"` + AttachedNamespace []HostNvmeNamespace `xml:"attachedNamespace,omitempty"` + VendorId string `xml:"vendorId,omitempty"` + Model string `xml:"model,omitempty"` + SerialNumber string `xml:"serialNumber,omitempty"` + FirmwareVersion string `xml:"firmwareVersion,omitempty"` +} + +func init() { + t["HostNvmeController"] = reflect.TypeOf((*HostNvmeController)(nil)).Elem() +} + +type HostNvmeDisconnectSpec struct { + DynamicData + + HbaName string `xml:"hbaName"` + Subnqn string `xml:"subnqn,omitempty"` + ControllerNumber int32 `xml:"controllerNumber,omitempty"` +} + +func init() { + t["HostNvmeDisconnectSpec"] = reflect.TypeOf((*HostNvmeDisconnectSpec)(nil)).Elem() +} + +type HostNvmeDiscoverSpec struct { + HostNvmeSpec + + AutoConnect *bool `xml:"autoConnect"` + RootDiscoveryController *bool `xml:"rootDiscoveryController"` +} + +func init() { + t["HostNvmeDiscoverSpec"] = reflect.TypeOf((*HostNvmeDiscoverSpec)(nil)).Elem() +} + +type HostNvmeDiscoveryLog struct { + DynamicData + + Entry []HostNvmeDiscoveryLogEntry `xml:"entry,omitempty"` + Complete bool `xml:"complete"` +} + +func init() { + t["HostNvmeDiscoveryLog"] = reflect.TypeOf((*HostNvmeDiscoveryLog)(nil)).Elem() +} + +type HostNvmeDiscoveryLogEntry struct { + DynamicData + + Subnqn string `xml:"subnqn"` + SubsystemType string `xml:"subsystemType"` + SubsystemPortId int32 `xml:"subsystemPortId"` + ControllerId int32 `xml:"controllerId"` + AdminQueueMaxSize int32 `xml:"adminQueueMaxSize"` + TransportParameters BaseHostNvmeTransportParameters `xml:"transportParameters,typeattr"` + TransportRequirements string `xml:"transportRequirements"` + Connected bool `xml:"connected"` +} + +func init() { + t["HostNvmeDiscoveryLogEntry"] = reflect.TypeOf((*HostNvmeDiscoveryLogEntry)(nil)).Elem() +} + +type HostNvmeNamespace struct { + DynamicData + + Key string `xml:"key"` + Name string `xml:"name"` + Id int32 `xml:"id"` + BlockSize int32 `xml:"blockSize"` + CapacityInBlocks int64 `xml:"capacityInBlocks"` +} + +func init() { + t["HostNvmeNamespace"] = reflect.TypeOf((*HostNvmeNamespace)(nil)).Elem() +} + +type HostNvmeOpaqueTransportParameters struct { + HostNvmeTransportParameters + + Trtype string `xml:"trtype"` + Traddr string `xml:"traddr"` + Adrfam string `xml:"adrfam"` + Trsvcid string `xml:"trsvcid"` + Tsas []byte `xml:"tsas"` +} + +func init() { + t["HostNvmeOpaqueTransportParameters"] = reflect.TypeOf((*HostNvmeOpaqueTransportParameters)(nil)).Elem() +} + +type HostNvmeOverFibreChannelParameters struct { + HostNvmeTransportParameters + + NodeWorldWideName int64 `xml:"nodeWorldWideName"` + PortWorldWideName int64 `xml:"portWorldWideName"` +} + +func init() { + t["HostNvmeOverFibreChannelParameters"] = reflect.TypeOf((*HostNvmeOverFibreChannelParameters)(nil)).Elem() +} + +type HostNvmeOverRdmaParameters struct { + HostNvmeTransportParameters + + Address string `xml:"address"` + AddressFamily string `xml:"addressFamily,omitempty"` + PortNumber int32 `xml:"portNumber,omitempty"` +} + +func init() { + t["HostNvmeOverRdmaParameters"] = reflect.TypeOf((*HostNvmeOverRdmaParameters)(nil)).Elem() +} + +type HostNvmeOverTcpParameters struct { + HostNvmeTransportParameters + + Address string `xml:"address"` + PortNumber int32 `xml:"portNumber,omitempty"` + DigestVerification string `xml:"digestVerification,omitempty"` +} + +func init() { + t["HostNvmeOverTcpParameters"] = reflect.TypeOf((*HostNvmeOverTcpParameters)(nil)).Elem() +} + +type HostNvmeSpec struct { + DynamicData + + HbaName string `xml:"hbaName"` + TransportParameters BaseHostNvmeTransportParameters `xml:"transportParameters,typeattr"` +} + +func init() { + t["HostNvmeSpec"] = reflect.TypeOf((*HostNvmeSpec)(nil)).Elem() +} + +type HostNvmeTopology struct { + DynamicData + + Adapter []HostNvmeTopologyInterface `xml:"adapter,omitempty"` +} + +func init() { + t["HostNvmeTopology"] = reflect.TypeOf((*HostNvmeTopology)(nil)).Elem() +} + +type HostNvmeTopologyInterface struct { + DynamicData + + Key string `xml:"key"` + Adapter string `xml:"adapter"` + ConnectedController []HostNvmeController `xml:"connectedController,omitempty"` +} + +func init() { + t["HostNvmeTopologyInterface"] = reflect.TypeOf((*HostNvmeTopologyInterface)(nil)).Elem() +} + +type HostNvmeTransportParameters struct { + DynamicData +} + +func init() { + t["HostNvmeTransportParameters"] = reflect.TypeOf((*HostNvmeTransportParameters)(nil)).Elem() +} + type HostOpaqueNetworkInfo struct { DynamicData @@ -23283,6 +25340,8 @@ type HostPciPassthruConfig struct { Id string `xml:"id"` PassthruEnabled bool `xml:"passthruEnabled"` + ApplyNow *bool `xml:"applyNow"` + HardwareLabel string `xml:"hardwareLabel,omitempty"` } func init() { @@ -23297,12 +25356,29 @@ type HostPciPassthruInfo struct { PassthruEnabled bool `xml:"passthruEnabled"` PassthruCapable bool `xml:"passthruCapable"` PassthruActive bool `xml:"passthruActive"` + HardwareLabel string `xml:"hardwareLabel,omitempty"` } func init() { t["HostPciPassthruInfo"] = reflect.TypeOf((*HostPciPassthruInfo)(nil)).Elem() } +type HostPcieHba struct { + HostHostBusAdapter +} + +func init() { + t["HostPcieHba"] = reflect.TypeOf((*HostPcieHba)(nil)).Elem() +} + +type HostPcieTargetTransport struct { + HostTargetTransport +} + +func init() { + t["HostPcieTargetTransport"] = reflect.TypeOf((*HostPcieTargetTransport)(nil)).Elem() +} + type HostPersistentMemoryInfo struct { DynamicData @@ -23738,18 +25814,27 @@ func init() { type HostProxySwitch struct { DynamicData - DvsUuid string `xml:"dvsUuid"` - DvsName string `xml:"dvsName"` - Key string `xml:"key"` - NumPorts int32 `xml:"numPorts"` - ConfigNumPorts int32 `xml:"configNumPorts,omitempty"` - NumPortsAvailable int32 `xml:"numPortsAvailable"` - UplinkPort []KeyValue `xml:"uplinkPort,omitempty"` - Mtu int32 `xml:"mtu,omitempty"` - Pnic []string `xml:"pnic,omitempty"` - Spec HostProxySwitchSpec `xml:"spec"` - HostLag []HostProxySwitchHostLagConfig `xml:"hostLag,omitempty"` - NetworkReservationSupported *bool `xml:"networkReservationSupported"` + DvsUuid string `xml:"dvsUuid"` + DvsName string `xml:"dvsName"` + Key string `xml:"key"` + NumPorts int32 `xml:"numPorts"` + ConfigNumPorts int32 `xml:"configNumPorts,omitempty"` + NumPortsAvailable int32 `xml:"numPortsAvailable"` + UplinkPort []KeyValue `xml:"uplinkPort,omitempty"` + Mtu int32 `xml:"mtu,omitempty"` + Pnic []string `xml:"pnic,omitempty"` + Spec HostProxySwitchSpec `xml:"spec"` + HostLag []HostProxySwitchHostLagConfig `xml:"hostLag,omitempty"` + NetworkReservationSupported *bool `xml:"networkReservationSupported"` + NsxtEnabled *bool `xml:"nsxtEnabled"` + EnsEnabled *bool `xml:"ensEnabled"` + EnsInterruptEnabled *bool `xml:"ensInterruptEnabled"` + TransportZones []DistributedVirtualSwitchHostMemberTransportZoneInfo `xml:"transportZones,omitempty"` + NsxUsedUplinkPort []string `xml:"nsxUsedUplinkPort,omitempty"` + NsxtStatus string `xml:"nsxtStatus,omitempty"` + NsxtStatusDetail string `xml:"nsxtStatusDetail,omitempty"` + EnsInfo *HostProxySwitchEnsInfo `xml:"ensInfo,omitempty"` + NetworkOffloadingEnabled *bool `xml:"networkOffloadingEnabled"` } func init() { @@ -23768,6 +25853,20 @@ func init() { t["HostProxySwitchConfig"] = reflect.TypeOf((*HostProxySwitchConfig)(nil)).Elem() } +type HostProxySwitchEnsInfo struct { + DynamicData + + OpsVersion int64 `xml:"opsVersion"` + NumPSOps int64 `xml:"numPSOps"` + NumLcoreOps int64 `xml:"numLcoreOps"` + ErrorStatus int64 `xml:"errorStatus"` + LcoreStatus int64 `xml:"lcoreStatus"` +} + +func init() { + t["HostProxySwitchEnsInfo"] = reflect.TypeOf((*HostProxySwitchEnsInfo)(nil)).Elem() +} + type HostProxySwitchHostLagConfig struct { DynamicData @@ -23790,6 +25889,117 @@ func init() { t["HostProxySwitchSpec"] = reflect.TypeOf((*HostProxySwitchSpec)(nil)).Elem() } +type HostPtpConfig struct { + DynamicData + + Domain int32 `xml:"domain,omitempty"` + Port []HostPtpConfigPtpPort `xml:"port,omitempty"` +} + +func init() { + t["HostPtpConfig"] = reflect.TypeOf((*HostPtpConfig)(nil)).Elem() +} + +type HostPtpConfigPtpPort struct { + DynamicData + + Index int32 `xml:"index"` + DeviceType string `xml:"deviceType,omitempty"` + Device string `xml:"device,omitempty"` + IpConfig *HostIpConfig `xml:"ipConfig,omitempty"` +} + +func init() { + t["HostPtpConfigPtpPort"] = reflect.TypeOf((*HostPtpConfigPtpPort)(nil)).Elem() +} + +type HostQualifiedName struct { + DynamicData + + Value string `xml:"value"` + Type string `xml:"type"` +} + +func init() { + t["HostQualifiedName"] = reflect.TypeOf((*HostQualifiedName)(nil)).Elem() +} + +type HostRdmaDevice struct { + DynamicData + + Key string `xml:"key"` + Device string `xml:"device"` + Driver string `xml:"driver,omitempty"` + Description string `xml:"description,omitempty"` + Backing BaseHostRdmaDeviceBacking `xml:"backing,omitempty,typeattr"` + ConnectionInfo HostRdmaDeviceConnectionInfo `xml:"connectionInfo"` + Capability HostRdmaDeviceCapability `xml:"capability"` +} + +func init() { + t["HostRdmaDevice"] = reflect.TypeOf((*HostRdmaDevice)(nil)).Elem() +} + +type HostRdmaDeviceBacking struct { + DynamicData +} + +func init() { + t["HostRdmaDeviceBacking"] = reflect.TypeOf((*HostRdmaDeviceBacking)(nil)).Elem() +} + +type HostRdmaDeviceCapability struct { + DynamicData + + RoceV1Capable bool `xml:"roceV1Capable"` + RoceV2Capable bool `xml:"roceV2Capable"` + IWarpCapable bool `xml:"iWarpCapable"` +} + +func init() { + t["HostRdmaDeviceCapability"] = reflect.TypeOf((*HostRdmaDeviceCapability)(nil)).Elem() +} + +type HostRdmaDeviceConnectionInfo struct { + DynamicData + + State string `xml:"state"` + Mtu int32 `xml:"mtu"` + SpeedInMbps int32 `xml:"speedInMbps"` +} + +func init() { + t["HostRdmaDeviceConnectionInfo"] = reflect.TypeOf((*HostRdmaDeviceConnectionInfo)(nil)).Elem() +} + +type HostRdmaDevicePnicBacking struct { + HostRdmaDeviceBacking + + PairedUplink string `xml:"pairedUplink"` +} + +func init() { + t["HostRdmaDevicePnicBacking"] = reflect.TypeOf((*HostRdmaDevicePnicBacking)(nil)).Elem() +} + +type HostRdmaHba struct { + HostHostBusAdapter + + AssociatedRdmaDevice string `xml:"associatedRdmaDevice,omitempty"` +} + +func init() { + t["HostRdmaHba"] = reflect.TypeOf((*HostRdmaHba)(nil)).Elem() +} + +type HostRdmaTargetTransport struct { + HostTargetTransport +} + +func init() { + t["HostRdmaTargetTransport"] = reflect.TypeOf((*HostRdmaTargetTransport)(nil)).Elem() +} + type HostReconcileDatastoreInventoryRequestType struct { This ManagedObjectReference `xml:"_this"` Datastore ManagedObjectReference `xml:"datastore"` @@ -23949,10 +26159,55 @@ func init() { t["HostRetrieveVStorageObject"] = reflect.TypeOf((*HostRetrieveVStorageObject)(nil)).Elem() } +type HostRetrieveVStorageObjectMetadata HostRetrieveVStorageObjectMetadataRequestType + +func init() { + t["HostRetrieveVStorageObjectMetadata"] = reflect.TypeOf((*HostRetrieveVStorageObjectMetadata)(nil)).Elem() +} + +type HostRetrieveVStorageObjectMetadataRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` + SnapshotId *ID `xml:"snapshotId,omitempty"` + Prefix string `xml:"prefix,omitempty"` +} + +func init() { + t["HostRetrieveVStorageObjectMetadataRequestType"] = reflect.TypeOf((*HostRetrieveVStorageObjectMetadataRequestType)(nil)).Elem() +} + +type HostRetrieveVStorageObjectMetadataResponse struct { + Returnval []KeyValue `xml:"returnval,omitempty"` +} + +type HostRetrieveVStorageObjectMetadataValue HostRetrieveVStorageObjectMetadataValueRequestType + +func init() { + t["HostRetrieveVStorageObjectMetadataValue"] = reflect.TypeOf((*HostRetrieveVStorageObjectMetadataValue)(nil)).Elem() +} + +type HostRetrieveVStorageObjectMetadataValueRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` + SnapshotId *ID `xml:"snapshotId,omitempty"` + Key string `xml:"key"` +} + +func init() { + t["HostRetrieveVStorageObjectMetadataValueRequestType"] = reflect.TypeOf((*HostRetrieveVStorageObjectMetadataValueRequestType)(nil)).Elem() +} + +type HostRetrieveVStorageObjectMetadataValueResponse struct { + Returnval string `xml:"returnval"` +} + type HostRetrieveVStorageObjectRequestType struct { - This ManagedObjectReference `xml:"_this"` - Id ID `xml:"id"` - Datastore ManagedObjectReference `xml:"datastore"` + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` + DiskInfoFlags []string `xml:"diskInfoFlags,omitempty"` } func init() { @@ -23986,21 +26241,23 @@ type HostRetrieveVStorageObjectStateResponse struct { type HostRuntimeInfo struct { DynamicData - ConnectionState HostSystemConnectionState `xml:"connectionState"` - PowerState HostSystemPowerState `xml:"powerState"` - StandbyMode string `xml:"standbyMode,omitempty"` - InMaintenanceMode bool `xml:"inMaintenanceMode"` - InQuarantineMode *bool `xml:"inQuarantineMode"` - BootTime *time.Time `xml:"bootTime"` - HealthSystemRuntime *HealthSystemRuntime `xml:"healthSystemRuntime,omitempty"` - DasHostState *ClusterDasFdmHostState `xml:"dasHostState,omitempty"` - TpmPcrValues []HostTpmDigestInfo `xml:"tpmPcrValues,omitempty"` - VsanRuntimeInfo *VsanHostRuntimeInfo `xml:"vsanRuntimeInfo,omitempty"` - NetworkRuntimeInfo *HostRuntimeInfoNetworkRuntimeInfo `xml:"networkRuntimeInfo,omitempty"` - VFlashResourceRuntimeInfo *HostVFlashManagerVFlashResourceRunTimeInfo `xml:"vFlashResourceRuntimeInfo,omitempty"` - HostMaxVirtualDiskCapacity int64 `xml:"hostMaxVirtualDiskCapacity,omitempty"` - CryptoState string `xml:"cryptoState,omitempty"` - CryptoKeyId *CryptoKeyId `xml:"cryptoKeyId,omitempty"` + ConnectionState HostSystemConnectionState `xml:"connectionState"` + PowerState HostSystemPowerState `xml:"powerState"` + StandbyMode string `xml:"standbyMode,omitempty"` + InMaintenanceMode bool `xml:"inMaintenanceMode"` + InQuarantineMode *bool `xml:"inQuarantineMode"` + BootTime *time.Time `xml:"bootTime"` + HealthSystemRuntime *HealthSystemRuntime `xml:"healthSystemRuntime,omitempty"` + DasHostState *ClusterDasFdmHostState `xml:"dasHostState,omitempty"` + TpmPcrValues []HostTpmDigestInfo `xml:"tpmPcrValues,omitempty"` + VsanRuntimeInfo *VsanHostRuntimeInfo `xml:"vsanRuntimeInfo,omitempty"` + NetworkRuntimeInfo *HostRuntimeInfoNetworkRuntimeInfo `xml:"networkRuntimeInfo,omitempty"` + VFlashResourceRuntimeInfo *HostVFlashManagerVFlashResourceRunTimeInfo `xml:"vFlashResourceRuntimeInfo,omitempty"` + HostMaxVirtualDiskCapacity int64 `xml:"hostMaxVirtualDiskCapacity,omitempty"` + CryptoState string `xml:"cryptoState,omitempty"` + CryptoKeyId *CryptoKeyId `xml:"cryptoKeyId,omitempty"` + StatelessNvdsMigrationReady string `xml:"statelessNvdsMigrationReady,omitempty"` + StateEncryption *HostRuntimeInfoStateEncryptionInfo `xml:"stateEncryption,omitempty"` } func init() { @@ -24032,6 +26289,18 @@ func init() { t["HostRuntimeInfoNetworkRuntimeInfo"] = reflect.TypeOf((*HostRuntimeInfoNetworkRuntimeInfo)(nil)).Elem() } +type HostRuntimeInfoStateEncryptionInfo struct { + DynamicData + + ProtectionMode string `xml:"protectionMode"` + RequireSecureBoot *bool `xml:"requireSecureBoot"` + RequireExecInstalledOnly *bool `xml:"requireExecInstalledOnly"` +} + +func init() { + t["HostRuntimeInfoStateEncryptionInfo"] = reflect.TypeOf((*HostRuntimeInfoStateEncryptionInfo)(nil)).Elem() +} + type HostScheduleReconcileDatastoreInventory HostScheduleReconcileDatastoreInventoryRequestType func init() { @@ -24239,6 +26508,46 @@ func init() { type HostSetVStorageObjectControlFlagsResponse struct { } +type HostSevInfo struct { + DynamicData + + SevState string `xml:"sevState"` + MaxSevEsGuests int64 `xml:"maxSevEsGuests"` +} + +func init() { + t["HostSevInfo"] = reflect.TypeOf((*HostSevInfo)(nil)).Elem() +} + +type HostSgxInfo struct { + DynamicData + + SgxState string `xml:"sgxState"` + TotalEpcMemory int64 `xml:"totalEpcMemory"` + FlcMode string `xml:"flcMode"` + LePubKeyHash string `xml:"lePubKeyHash,omitempty"` + RegistrationInfo *HostSgxRegistrationInfo `xml:"registrationInfo,omitempty"` +} + +func init() { + t["HostSgxInfo"] = reflect.TypeOf((*HostSgxInfo)(nil)).Elem() +} + +type HostSgxRegistrationInfo struct { + DynamicData + + Status string `xml:"status,omitempty"` + BiosError int32 `xml:"biosError,omitempty"` + RegistrationUrl string `xml:"registrationUrl,omitempty"` + Type string `xml:"type,omitempty"` + Ppid string `xml:"ppid,omitempty"` + LastRegisteredTime *time.Time `xml:"lastRegisteredTime"` +} + +func init() { + t["HostSgxRegistrationInfo"] = reflect.TypeOf((*HostSgxRegistrationInfo)(nil)).Elem() +} + type HostSharedGpuCapabilities struct { DynamicData @@ -24358,6 +26667,14 @@ func init() { t["HostSpecification"] = reflect.TypeOf((*HostSpecification)(nil)).Elem() } +type HostSpecificationChangedEvent struct { + HostEvent +} + +func init() { + t["HostSpecificationChangedEvent"] = reflect.TypeOf((*HostSpecificationChangedEvent)(nil)).Elem() +} + type HostSpecificationOperationFailed struct { VimFault @@ -24374,6 +26691,24 @@ func init() { t["HostSpecificationOperationFailedFault"] = reflect.TypeOf((*HostSpecificationOperationFailedFault)(nil)).Elem() } +type HostSpecificationRequireEvent struct { + HostEvent +} + +func init() { + t["HostSpecificationRequireEvent"] = reflect.TypeOf((*HostSpecificationRequireEvent)(nil)).Elem() +} + +type HostSpecificationUpdateEvent struct { + HostEvent + + HostSpec HostSpecification `xml:"hostSpec"` +} + +func init() { + t["HostSpecificationUpdateEvent"] = reflect.TypeOf((*HostSpecificationUpdateEvent)(nil)).Elem() +} + type HostSriovConfig struct { HostPciPassthruConfig @@ -24458,6 +26793,7 @@ type HostStorageDeviceInfo struct { HostBusAdapter []BaseHostHostBusAdapter `xml:"hostBusAdapter,omitempty,typeattr"` ScsiLun []BaseScsiLun `xml:"scsiLun,omitempty,typeattr"` ScsiTopology *HostScsiTopology `xml:"scsiTopology,omitempty"` + NvmeTopology *HostNvmeTopology `xml:"nvmeTopology,omitempty"` MultipathInfo *HostMultipathInfo `xml:"multipathInfo,omitempty"` PlugStoreTopology *HostPlugStoreTopology `xml:"plugStoreTopology,omitempty"` SoftwareInternetScsiEnabled bool `xml:"softwareInternetScsiEnabled"` @@ -24534,6 +26870,26 @@ func init() { t["HostSubSpecification"] = reflect.TypeOf((*HostSubSpecification)(nil)).Elem() } +type HostSubSpecificationDeleteEvent struct { + HostEvent + + SubSpecName string `xml:"subSpecName"` +} + +func init() { + t["HostSubSpecificationDeleteEvent"] = reflect.TypeOf((*HostSubSpecificationDeleteEvent)(nil)).Elem() +} + +type HostSubSpecificationUpdateEvent struct { + HostEvent + + HostSubSpec HostSubSpecification `xml:"hostSubSpec"` +} + +func init() { + t["HostSubSpecificationUpdateEvent"] = reflect.TypeOf((*HostSubSpecificationUpdateEvent)(nil)).Elem() +} + type HostSyncFailedEvent struct { HostEvent @@ -24584,6 +26940,9 @@ type HostSystemInfo struct { Uuid string `xml:"uuid"` OtherIdentifyingInfo []HostSystemIdentificationInfo `xml:"otherIdentifyingInfo,omitempty"` SerialNumber string `xml:"serialNumber,omitempty"` + QualifiedName []HostQualifiedName `xml:"qualifiedName,omitempty"` + VvolHostNQN *HostQualifiedName `xml:"vvolHostNQN,omitempty"` + VvolHostId string `xml:"vvolHostId,omitempty"` } func init() { @@ -24685,6 +27044,34 @@ func init() { t["HostTargetTransport"] = reflect.TypeOf((*HostTargetTransport)(nil)).Elem() } +type HostTcpHba struct { + HostHostBusAdapter + + AssociatedPnic string `xml:"associatedPnic,omitempty"` +} + +func init() { + t["HostTcpHba"] = reflect.TypeOf((*HostTcpHba)(nil)).Elem() +} + +type HostTcpHbaCreateSpec struct { + HostHbaCreateSpec + + Pnic string `xml:"pnic"` +} + +func init() { + t["HostTcpHbaCreateSpec"] = reflect.TypeOf((*HostTcpHbaCreateSpec)(nil)).Elem() +} + +type HostTcpTargetTransport struct { + HostTargetTransport +} + +func init() { + t["HostTcpTargetTransport"] = reflect.TypeOf((*HostTcpTargetTransport)(nil)).Elem() +} + type HostTpmAttestationInfo struct { DynamicData @@ -24761,6 +27148,14 @@ func init() { t["HostTpmEventLogEntry"] = reflect.TypeOf((*HostTpmEventLogEntry)(nil)).Elem() } +type HostTpmNvTagEventDetails struct { + HostTpmBootSecurityOptionEventDetails +} + +func init() { + t["HostTpmNvTagEventDetails"] = reflect.TypeOf((*HostTpmNvTagEventDetails)(nil)).Elem() +} + type HostTpmOptionEventDetails struct { HostTpmEventDetails @@ -24772,6 +27167,14 @@ func init() { t["HostTpmOptionEventDetails"] = reflect.TypeOf((*HostTpmOptionEventDetails)(nil)).Elem() } +type HostTpmSignerEventDetails struct { + HostTpmBootSecurityOptionEventDetails +} + +func init() { + t["HostTpmSignerEventDetails"] = reflect.TypeOf((*HostTpmSignerEventDetails)(nil)).Elem() +} + type HostTpmSoftwareComponentEventDetails struct { HostTpmEventDetails @@ -24785,6 +27188,30 @@ func init() { t["HostTpmSoftwareComponentEventDetails"] = reflect.TypeOf((*HostTpmSoftwareComponentEventDetails)(nil)).Elem() } +type HostTpmVersionEventDetails struct { + HostTpmEventDetails + + Version []byte `xml:"version"` +} + +func init() { + t["HostTpmVersionEventDetails"] = reflect.TypeOf((*HostTpmVersionEventDetails)(nil)).Elem() +} + +type HostTrustAuthorityAttestationInfo struct { + DynamicData + + AttestationStatus string `xml:"attestationStatus"` + ServiceId string `xml:"serviceId,omitempty"` + AttestedAt *time.Time `xml:"attestedAt"` + AttestedUntil *time.Time `xml:"attestedUntil"` + Messages []LocalizableMessage `xml:"messages,omitempty"` +} + +func init() { + t["HostTrustAuthorityAttestationInfo"] = reflect.TypeOf((*HostTrustAuthorityAttestationInfo)(nil)).Elem() +} + type HostUnresolvedVmfsExtent struct { DynamicData @@ -24861,6 +27288,50 @@ func init() { t["HostUnresolvedVmfsVolumeResolveStatus"] = reflect.TypeOf((*HostUnresolvedVmfsVolumeResolveStatus)(nil)).Elem() } +type HostUpdateVStorageObjectMetadataExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` + Metadata []KeyValue `xml:"metadata,omitempty"` + DeleteKeys []string `xml:"deleteKeys,omitempty"` +} + +func init() { + t["HostUpdateVStorageObjectMetadataExRequestType"] = reflect.TypeOf((*HostUpdateVStorageObjectMetadataExRequestType)(nil)).Elem() +} + +type HostUpdateVStorageObjectMetadataEx_Task HostUpdateVStorageObjectMetadataExRequestType + +func init() { + t["HostUpdateVStorageObjectMetadataEx_Task"] = reflect.TypeOf((*HostUpdateVStorageObjectMetadataEx_Task)(nil)).Elem() +} + +type HostUpdateVStorageObjectMetadataEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type HostUpdateVStorageObjectMetadataRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` + Metadata []KeyValue `xml:"metadata,omitempty"` + DeleteKeys []string `xml:"deleteKeys,omitempty"` +} + +func init() { + t["HostUpdateVStorageObjectMetadataRequestType"] = reflect.TypeOf((*HostUpdateVStorageObjectMetadataRequestType)(nil)).Elem() +} + +type HostUpdateVStorageObjectMetadata_Task HostUpdateVStorageObjectMetadataRequestType + +func init() { + t["HostUpdateVStorageObjectMetadata_Task"] = reflect.TypeOf((*HostUpdateVStorageObjectMetadata_Task)(nil)).Elem() +} + +type HostUpdateVStorageObjectMetadata_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + type HostUpgradeFailedEvent struct { HostEvent } @@ -25008,6 +27479,39 @@ func init() { t["HostVMotionInfo"] = reflect.TypeOf((*HostVMotionInfo)(nil)).Elem() } +type HostVMotionManagerDstInstantCloneResult struct { + DynamicData + + DstVmId int32 `xml:"dstVmId,omitempty"` + StartTime int64 `xml:"startTime,omitempty"` + CptLoadTime int64 `xml:"cptLoadTime,omitempty"` + CptLoadDoneTime int64 `xml:"cptLoadDoneTime,omitempty"` + ReplicateMemDoneTime int64 `xml:"replicateMemDoneTime,omitempty"` + EndTime int64 `xml:"endTime,omitempty"` + CptXferTime int64 `xml:"cptXferTime,omitempty"` + CptCacheUsed int64 `xml:"cptCacheUsed,omitempty"` + DevCptStreamSize int64 `xml:"devCptStreamSize,omitempty"` + DevCptStreamTime int64 `xml:"devCptStreamTime,omitempty"` +} + +func init() { + t["HostVMotionManagerDstInstantCloneResult"] = reflect.TypeOf((*HostVMotionManagerDstInstantCloneResult)(nil)).Elem() +} + +type HostVMotionManagerSrcInstantCloneResult struct { + DynamicData + + StartTime int64 `xml:"startTime,omitempty"` + QuiesceTime int64 `xml:"quiesceTime,omitempty"` + QuiesceDoneTime int64 `xml:"quiesceDoneTime,omitempty"` + ResumeDoneTime int64 `xml:"resumeDoneTime,omitempty"` + EndTime int64 `xml:"endTime,omitempty"` +} + +func init() { + t["HostVMotionManagerSrcInstantCloneResult"] = reflect.TypeOf((*HostVMotionManagerSrcInstantCloneResult)(nil)).Elem() +} + type HostVMotionNetConfig struct { DynamicData @@ -25020,14 +27524,15 @@ func init() { } type HostVStorageObjectCreateDiskFromSnapshotRequestType struct { - This ManagedObjectReference `xml:"_this"` - Id ID `xml:"id"` - Datastore ManagedObjectReference `xml:"datastore"` - SnapshotId ID `xml:"snapshotId"` - Name string `xml:"name"` - Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` - Crypto BaseCryptoSpec `xml:"crypto,omitempty,typeattr"` - Path string `xml:"path,omitempty"` + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` + SnapshotId ID `xml:"snapshotId"` + Name string `xml:"name"` + Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` + Crypto BaseCryptoSpec `xml:"crypto,omitempty,typeattr"` + Path string `xml:"path,omitempty"` + ProvisioningType string `xml:"provisioningType,omitempty"` } func init() { @@ -25256,6 +27761,8 @@ type HostVirtualNicSpec struct { ExternalId string `xml:"externalId,omitempty"` PinnedPnic string `xml:"pinnedPnic,omitempty"` IpRouteSpec *HostVirtualNicIpRouteSpec `xml:"ipRouteSpec,omitempty"` + SystemOwned *bool `xml:"systemOwned"` + DpuId string `xml:"dpuId,omitempty"` } func init() { @@ -25479,10 +27986,11 @@ func init() { type HostVvolVolume struct { HostFileSystemVolume - ScId string `xml:"scId"` - HostPE []VVolHostPE `xml:"hostPE,omitempty"` - VasaProviderInfo []VimVasaProviderInfo `xml:"vasaProviderInfo,omitempty"` - StorageArray []VASAStorageArray `xml:"storageArray,omitempty"` + ScId string `xml:"scId"` + HostPE []VVolHostPE `xml:"hostPE,omitempty"` + VasaProviderInfo []VimVasaProviderInfo `xml:"vasaProviderInfo,omitempty"` + StorageArray []VASAStorageArray `xml:"storageArray,omitempty"` + ProtocolEndpointType string `xml:"protocolEndpointType,omitempty"` } func init() { @@ -25704,6 +28212,36 @@ func init() { t["HttpNfcLeaseManifestEntry"] = reflect.TypeOf((*HttpNfcLeaseManifestEntry)(nil)).Elem() } +type HttpNfcLeaseProbeResult struct { + DynamicData + + ServerAccessible bool `xml:"serverAccessible"` +} + +func init() { + t["HttpNfcLeaseProbeResult"] = reflect.TypeOf((*HttpNfcLeaseProbeResult)(nil)).Elem() +} + +type HttpNfcLeaseProbeUrls HttpNfcLeaseProbeUrlsRequestType + +func init() { + t["HttpNfcLeaseProbeUrls"] = reflect.TypeOf((*HttpNfcLeaseProbeUrls)(nil)).Elem() +} + +type HttpNfcLeaseProbeUrlsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Files []HttpNfcLeaseSourceFile `xml:"files,omitempty"` + Timeout int32 `xml:"timeout,omitempty"` +} + +func init() { + t["HttpNfcLeaseProbeUrlsRequestType"] = reflect.TypeOf((*HttpNfcLeaseProbeUrlsRequestType)(nil)).Elem() +} + +type HttpNfcLeaseProbeUrlsResponse struct { + Returnval []HttpNfcLeaseProbeResult `xml:"returnval,omitempty"` +} + type HttpNfcLeaseProgress HttpNfcLeaseProgressRequestType func init() { @@ -27319,7 +29857,7 @@ func init() { type InvalidOperationOnSecondaryVm struct { VmFaultToleranceIssue - InstanceUuid string `xml:"instanceUuid,omitempty"` + InstanceUuid string `xml:"instanceUuid"` } func init() { @@ -27716,6 +30254,25 @@ func init() { t["IpRouteProfile"] = reflect.TypeOf((*IpRouteProfile)(nil)).Elem() } +type IsKmsClusterActive IsKmsClusterActiveRequestType + +func init() { + t["IsKmsClusterActive"] = reflect.TypeOf((*IsKmsClusterActive)(nil)).Elem() +} + +type IsKmsClusterActiveRequestType struct { + This ManagedObjectReference `xml:"_this"` + Cluster *KeyProviderId `xml:"cluster,omitempty"` +} + +func init() { + t["IsKmsClusterActiveRequestType"] = reflect.TypeOf((*IsKmsClusterActiveRequestType)(nil)).Elem() +} + +type IsKmsClusterActiveResponse struct { + Returnval bool `xml:"returnval"` +} + type IsSharedGraphicsActive IsSharedGraphicsActiveRequestType func init() { @@ -28083,6 +30640,22 @@ func init() { t["KeyAnyValue"] = reflect.TypeOf((*KeyAnyValue)(nil)).Elem() } +type KeyNotFound struct { + VimFault + + Key string `xml:"key"` +} + +func init() { + t["KeyNotFound"] = reflect.TypeOf((*KeyNotFound)(nil)).Elem() +} + +type KeyNotFoundFault KeyNotFound + +func init() { + t["KeyNotFoundFault"] = reflect.TypeOf((*KeyNotFoundFault)(nil)).Elem() +} + type KeyProviderId struct { DynamicData @@ -28107,9 +30680,14 @@ func init() { type KmipClusterInfo struct { DynamicData - ClusterId KeyProviderId `xml:"clusterId"` - Servers []KmipServerInfo `xml:"servers,omitempty"` - UseAsDefault bool `xml:"useAsDefault"` + ClusterId KeyProviderId `xml:"clusterId"` + Servers []KmipServerInfo `xml:"servers,omitempty"` + UseAsDefault bool `xml:"useAsDefault"` + ManagementType string `xml:"managementType,omitempty"` + UseAsEntityDefault []ManagedObjectReference `xml:"useAsEntityDefault,omitempty"` + HasBackup *bool `xml:"hasBackup"` + TpmRequired *bool `xml:"tpmRequired"` + KeyId string `xml:"keyId,omitempty"` } func init() { @@ -28754,6 +31332,27 @@ type ListKmipServersResponse struct { Returnval []KmipClusterInfo `xml:"returnval,omitempty"` } +type ListKmsClusters ListKmsClustersRequestType + +func init() { + t["ListKmsClusters"] = reflect.TypeOf((*ListKmsClusters)(nil)).Elem() +} + +type ListKmsClustersRequestType struct { + This ManagedObjectReference `xml:"_this"` + IncludeKmsServers *bool `xml:"includeKmsServers"` + ManagementTypeFilter int32 `xml:"managementTypeFilter,omitempty"` + StatusFilter int32 `xml:"statusFilter,omitempty"` +} + +func init() { + t["ListKmsClustersRequestType"] = reflect.TypeOf((*ListKmsClustersRequestType)(nil)).Elem() +} + +type ListKmsClustersResponse struct { + Returnval []KmipClusterInfo `xml:"returnval,omitempty"` +} + type ListProcessesInGuest ListProcessesInGuestRequestType func init() { @@ -29495,6 +32094,63 @@ func init() { type MarkForRemovalResponse struct { } +type MarkPerenniallyReserved MarkPerenniallyReservedRequestType + +func init() { + t["MarkPerenniallyReserved"] = reflect.TypeOf((*MarkPerenniallyReserved)(nil)).Elem() +} + +type MarkPerenniallyReservedExRequestType struct { + This ManagedObjectReference `xml:"_this"` + LunUuid []string `xml:"lunUuid,omitempty"` + State bool `xml:"state"` +} + +func init() { + t["MarkPerenniallyReservedExRequestType"] = reflect.TypeOf((*MarkPerenniallyReservedExRequestType)(nil)).Elem() +} + +type MarkPerenniallyReservedEx_Task MarkPerenniallyReservedExRequestType + +func init() { + t["MarkPerenniallyReservedEx_Task"] = reflect.TypeOf((*MarkPerenniallyReservedEx_Task)(nil)).Elem() +} + +type MarkPerenniallyReservedEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + +type MarkPerenniallyReservedRequestType struct { + This ManagedObjectReference `xml:"_this"` + LunUuid string `xml:"lunUuid"` + State bool `xml:"state"` +} + +func init() { + t["MarkPerenniallyReservedRequestType"] = reflect.TypeOf((*MarkPerenniallyReservedRequestType)(nil)).Elem() +} + +type MarkPerenniallyReservedResponse struct { +} + +type MarkServiceProviderEntities MarkServiceProviderEntitiesRequestType + +func init() { + t["MarkServiceProviderEntities"] = reflect.TypeOf((*MarkServiceProviderEntities)(nil)).Elem() +} + +type MarkServiceProviderEntitiesRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity []ManagedObjectReference `xml:"entity,omitempty"` +} + +func init() { + t["MarkServiceProviderEntitiesRequestType"] = reflect.TypeOf((*MarkServiceProviderEntitiesRequestType)(nil)).Elem() +} + +type MarkServiceProviderEntitiesResponse struct { +} + type MemoryFileFormatNotSupportedByDatastore struct { UnsupportedDatastore @@ -31006,6 +33662,7 @@ type NetworkProfile struct { DvsHostNic []DvsHostVNicProfile `xml:"dvsHostNic,omitempty"` NsxHostNic []NsxHostVNicProfile `xml:"nsxHostNic,omitempty"` NetStackInstance []NetStackInstanceProfile `xml:"netStackInstance,omitempty"` + OpaqueSwitch *OpaqueSwitchProfile `xml:"opaqueSwitch,omitempty"` } func init() { @@ -31037,8 +33694,8 @@ type NetworkSummary struct { Network *ManagedObjectReference `xml:"network,omitempty"` Name string `xml:"name"` Accessible bool `xml:"accessible"` - IpPoolName string `xml:"ipPoolName,omitempty"` - IpPoolId int32 `xml:"ipPoolId,omitempty"` + IpPoolName string `xml:"ipPoolName"` + IpPoolId *int32 `xml:"ipPoolId"` } func init() { @@ -31387,14 +34044,26 @@ func init() { type NoPermission struct { SecurityError - Object ManagedObjectReference `xml:"object"` - PrivilegeId string `xml:"privilegeId"` + Object *ManagedObjectReference `xml:"object,omitempty"` + PrivilegeId string `xml:"privilegeId,omitempty"` + MissingPrivileges []NoPermissionEntityPrivileges `xml:"missingPrivileges,omitempty"` } func init() { t["NoPermission"] = reflect.TypeOf((*NoPermission)(nil)).Elem() } +type NoPermissionEntityPrivileges struct { + DynamicData + + Entity ManagedObjectReference `xml:"entity"` + PrivilegeIds []string `xml:"privilegeIds,omitempty"` +} + +func init() { + t["NoPermissionEntityPrivileges"] = reflect.TypeOf((*NoPermissionEntityPrivileges)(nil)).Elem() +} + type NoPermissionFault BaseNoPermission func init() { @@ -32101,6 +34770,22 @@ func init() { t["NvdimmNamespaceDeleteSpec"] = reflect.TypeOf((*NvdimmNamespaceDeleteSpec)(nil)).Elem() } +type NvdimmNamespaceDetails struct { + DynamicData + + Uuid string `xml:"uuid"` + FriendlyName string `xml:"friendlyName"` + Size int64 `xml:"size"` + Type string `xml:"type"` + NamespaceHealthStatus string `xml:"namespaceHealthStatus"` + InterleavesetID int32 `xml:"interleavesetID"` + State string `xml:"state"` +} + +func init() { + t["NvdimmNamespaceDetails"] = reflect.TypeOf((*NvdimmNamespaceDetails)(nil)).Elem() +} + type NvdimmNamespaceInfo struct { DynamicData @@ -32118,6 +34803,18 @@ func init() { t["NvdimmNamespaceInfo"] = reflect.TypeOf((*NvdimmNamespaceInfo)(nil)).Elem() } +type NvdimmPMemNamespaceCreateSpec struct { + DynamicData + + FriendlyName string `xml:"friendlyName,omitempty"` + Size int64 `xml:"size"` + InterleavesetID int32 `xml:"interleavesetID"` +} + +func init() { + t["NvdimmPMemNamespaceCreateSpec"] = reflect.TypeOf((*NvdimmPMemNamespaceCreateSpec)(nil)).Elem() +} + type NvdimmRegionInfo struct { DynamicData @@ -32160,6 +34857,7 @@ type NvdimmSystemInfo struct { ISetInfo []NvdimmInterleaveSetInfo `xml:"iSetInfo,omitempty"` Namespace []NvdimmGuid `xml:"namespace,omitempty"` NsInfo []NvdimmNamespaceInfo `xml:"nsInfo,omitempty"` + NsDetails []NvdimmNamespaceDetails `xml:"nsDetails,omitempty"` } func init() { @@ -32245,6 +34943,14 @@ func init() { t["OpaqueNetworkTargetInfo"] = reflect.TypeOf((*OpaqueNetworkTargetInfo)(nil)).Elem() } +type OpaqueSwitchProfile struct { + ApplyProfile +} + +func init() { + t["OpaqueSwitchProfile"] = reflect.TypeOf((*OpaqueSwitchProfile)(nil)).Elem() +} + type OpenInventoryViewFolder OpenInventoryViewFolderRequestType func init() { @@ -33972,6 +36678,20 @@ func init() { t["PassiveNodeNetworkSpec"] = reflect.TypeOf((*PassiveNodeNetworkSpec)(nil)).Elem() } +type PasswordExpired struct { + InvalidLogin +} + +func init() { + t["PasswordExpired"] = reflect.TypeOf((*PasswordExpired)(nil)).Elem() +} + +type PasswordExpiredFault PasswordExpired + +func init() { + t["PasswordExpiredFault"] = reflect.TypeOf((*PasswordExpiredFault)(nil)).Elem() +} + type PasswordField struct { DynamicData @@ -34479,6 +37199,8 @@ type PhysicalNic struct { Device string `xml:"device"` Pci string `xml:"pci"` Driver string `xml:"driver,omitempty"` + DriverVersion string `xml:"driverVersion,omitempty"` + FirmwareVersion string `xml:"firmwareVersion,omitempty"` LinkSpeed *PhysicalNicLinkInfo `xml:"linkSpeed,omitempty"` ValidLinkSpecification []PhysicalNicLinkInfo `xml:"validLinkSpecification,omitempty"` Spec PhysicalNicSpec `xml:"spec"` @@ -34491,6 +37213,9 @@ type PhysicalNic struct { ResourcePoolSchedulerDisallowedReason []string `xml:"resourcePoolSchedulerDisallowedReason,omitempty"` AutoNegotiateSupported *bool `xml:"autoNegotiateSupported"` EnhancedNetworkingStackSupported *bool `xml:"enhancedNetworkingStackSupported"` + EnsInterruptSupported *bool `xml:"ensInterruptSupported"` + RdmaDevice string `xml:"rdmaDevice,omitempty"` + DpuId string `xml:"dpuId,omitempty"` } func init() { @@ -34623,6 +37348,7 @@ type PhysicalNicSpec struct { Ip *HostIpConfig `xml:"ip,omitempty"` LinkSpeed *PhysicalNicLinkInfo `xml:"linkSpeed,omitempty"` EnableEnhancedNetworkingStack *bool `xml:"enableEnhancedNetworkingStack"` + EnsInterruptEnabled *bool `xml:"ensInterruptEnabled"` } func init() { @@ -35909,6 +38635,26 @@ type QueryCompatibleHostForNewDvsResponse struct { Returnval []ManagedObjectReference `xml:"returnval,omitempty"` } +type QueryCompatibleVmnicsFromHosts QueryCompatibleVmnicsFromHostsRequestType + +func init() { + t["QueryCompatibleVmnicsFromHosts"] = reflect.TypeOf((*QueryCompatibleVmnicsFromHosts)(nil)).Elem() +} + +type QueryCompatibleVmnicsFromHostsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Hosts []ManagedObjectReference `xml:"hosts,omitempty"` + Dvs ManagedObjectReference `xml:"dvs"` +} + +func init() { + t["QueryCompatibleVmnicsFromHostsRequestType"] = reflect.TypeOf((*QueryCompatibleVmnicsFromHostsRequestType)(nil)).Elem() +} + +type QueryCompatibleVmnicsFromHostsResponse struct { + Returnval []DVSManagerPhysicalNicsList `xml:"returnval,omitempty"` +} + type QueryComplianceStatus QueryComplianceStatusRequestType func init() { @@ -36066,6 +38812,44 @@ type QueryConnectionInfoViaSpecResponse struct { Returnval HostConnectInfo `xml:"returnval"` } +type QueryConnections QueryConnectionsRequestType + +func init() { + t["QueryConnections"] = reflect.TypeOf((*QueryConnections)(nil)).Elem() +} + +type QueryConnectionsRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryConnectionsRequestType"] = reflect.TypeOf((*QueryConnectionsRequestType)(nil)).Elem() +} + +type QueryConnectionsResponse struct { + Returnval []BaseVirtualMachineConnection `xml:"returnval,omitempty,typeattr"` +} + +type QueryCryptoKeyStatus QueryCryptoKeyStatusRequestType + +func init() { + t["QueryCryptoKeyStatus"] = reflect.TypeOf((*QueryCryptoKeyStatus)(nil)).Elem() +} + +type QueryCryptoKeyStatusRequestType struct { + This ManagedObjectReference `xml:"_this"` + KeyIds []CryptoKeyId `xml:"keyIds,omitempty"` + CheckKeyBitMap int32 `xml:"checkKeyBitMap"` +} + +func init() { + t["QueryCryptoKeyStatusRequestType"] = reflect.TypeOf((*QueryCryptoKeyStatusRequestType)(nil)).Elem() +} + +type QueryCryptoKeyStatusResponse struct { + Returnval []CryptoManagerKmipCryptoKeyStatus `xml:"returnval,omitempty"` +} + type QueryDatastorePerformanceSummary QueryDatastorePerformanceSummaryRequestType func init() { @@ -36561,6 +39345,25 @@ type QueryHostStatusResponse struct { Returnval VsanHostClusterStatus `xml:"returnval"` } +type QueryHostsWithAttachedLun QueryHostsWithAttachedLunRequestType + +func init() { + t["QueryHostsWithAttachedLun"] = reflect.TypeOf((*QueryHostsWithAttachedLun)(nil)).Elem() +} + +type QueryHostsWithAttachedLunRequestType struct { + This ManagedObjectReference `xml:"_this"` + LunUuid string `xml:"lunUuid"` +} + +func init() { + t["QueryHostsWithAttachedLunRequestType"] = reflect.TypeOf((*QueryHostsWithAttachedLunRequestType)(nil)).Elem() +} + +type QueryHostsWithAttachedLunResponse struct { + Returnval []ManagedObjectReference `xml:"returnval,omitempty"` +} + type QueryIORMConfigOption QueryIORMConfigOptionRequestType func init() { @@ -36734,6 +39537,25 @@ type QueryManagedByResponse struct { Returnval []ManagedObjectReference `xml:"returnval,omitempty"` } +type QueryMaxQueueDepth QueryMaxQueueDepthRequestType + +func init() { + t["QueryMaxQueueDepth"] = reflect.TypeOf((*QueryMaxQueueDepth)(nil)).Elem() +} + +type QueryMaxQueueDepthRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datastore ManagedObjectReference `xml:"datastore"` +} + +func init() { + t["QueryMaxQueueDepthRequestType"] = reflect.TypeOf((*QueryMaxQueueDepthRequestType)(nil)).Elem() +} + +type QueryMaxQueueDepthResponse struct { + Returnval int64 `xml:"returnval"` +} + type QueryMemoryOverhead QueryMemoryOverheadRequestType func init() { @@ -37135,6 +39957,24 @@ type QueryPolicyMetadataResponse struct { Returnval []ProfilePolicyMetadata `xml:"returnval,omitempty"` } +type QueryProductLockerLocation QueryProductLockerLocationRequestType + +func init() { + t["QueryProductLockerLocation"] = reflect.TypeOf((*QueryProductLockerLocation)(nil)).Elem() +} + +type QueryProductLockerLocationRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["QueryProductLockerLocationRequestType"] = reflect.TypeOf((*QueryProductLockerLocationRequestType)(nil)).Elem() +} + +type QueryProductLockerLocationResponse struct { + Returnval string `xml:"returnval"` +} + type QueryProfileStructure QueryProfileStructureRequestType func init() { @@ -37266,6 +40106,25 @@ type QuerySupportedFeaturesResponse struct { Returnval []LicenseFeatureInfo `xml:"returnval,omitempty"` } +type QuerySupportedNetworkOffloadSpec QuerySupportedNetworkOffloadSpecRequestType + +func init() { + t["QuerySupportedNetworkOffloadSpec"] = reflect.TypeOf((*QuerySupportedNetworkOffloadSpec)(nil)).Elem() +} + +type QuerySupportedNetworkOffloadSpecRequestType struct { + This ManagedObjectReference `xml:"_this"` + SwitchProductSpec DistributedVirtualSwitchProductSpec `xml:"switchProductSpec"` +} + +func init() { + t["QuerySupportedNetworkOffloadSpecRequestType"] = reflect.TypeOf((*QuerySupportedNetworkOffloadSpecRequestType)(nil)).Elem() +} + +type QuerySupportedNetworkOffloadSpecResponse struct { + Returnval []DistributedVirtualSwitchNetworkOffloadSpec `xml:"returnval,omitempty"` +} + type QuerySyncingVsanObjects QuerySyncingVsanObjectsRequestType func init() { @@ -38860,6 +41719,25 @@ func init() { type RegisterKmipServerResponse struct { } +type RegisterKmsCluster RegisterKmsClusterRequestType + +func init() { + t["RegisterKmsCluster"] = reflect.TypeOf((*RegisterKmsCluster)(nil)).Elem() +} + +type RegisterKmsClusterRequestType struct { + This ManagedObjectReference `xml:"_this"` + ClusterId KeyProviderId `xml:"clusterId"` + ManagementType string `xml:"managementType,omitempty"` +} + +func init() { + t["RegisterKmsClusterRequestType"] = reflect.TypeOf((*RegisterKmsClusterRequestType)(nil)).Elem() +} + +type RegisterKmsClusterResponse struct { +} + type RegisterVMRequestType struct { This ManagedObjectReference `xml:"_this"` Path string `xml:"path"` @@ -39345,6 +42223,7 @@ type RemoveInternetScsiSendTargetsRequestType struct { This ManagedObjectReference `xml:"_this"` IScsiHbaDevice string `xml:"iScsiHbaDevice"` Targets []HostInternetScsiHbaSendTarget `xml:"targets"` + Force *bool `xml:"force"` } func init() { @@ -39505,6 +42384,24 @@ func init() { type RemoveNetworkResourcePoolResponse struct { } +type RemoveNvmeOverRdmaAdapter RemoveNvmeOverRdmaAdapterRequestType + +func init() { + t["RemoveNvmeOverRdmaAdapter"] = reflect.TypeOf((*RemoveNvmeOverRdmaAdapter)(nil)).Elem() +} + +type RemoveNvmeOverRdmaAdapterRequestType struct { + This ManagedObjectReference `xml:"_this"` + HbaDeviceName string `xml:"hbaDeviceName"` +} + +func init() { + t["RemoveNvmeOverRdmaAdapterRequestType"] = reflect.TypeOf((*RemoveNvmeOverRdmaAdapterRequestType)(nil)).Elem() +} + +type RemoveNvmeOverRdmaAdapterResponse struct { +} + type RemovePerfInterval RemovePerfIntervalRequestType func init() { @@ -39634,6 +42531,24 @@ type RemoveSnapshot_TaskResponse struct { Returnval ManagedObjectReference `xml:"returnval"` } +type RemoveSoftwareAdapter RemoveSoftwareAdapterRequestType + +func init() { + t["RemoveSoftwareAdapter"] = reflect.TypeOf((*RemoveSoftwareAdapter)(nil)).Elem() +} + +type RemoveSoftwareAdapterRequestType struct { + This ManagedObjectReference `xml:"_this"` + HbaDeviceName string `xml:"hbaDeviceName"` +} + +func init() { + t["RemoveSoftwareAdapterRequestType"] = reflect.TypeOf((*RemoveSoftwareAdapterRequestType)(nil)).Elem() +} + +type RemoveSoftwareAdapterResponse struct { +} + type RemoveUser RemoveUserRequestType func init() { @@ -39869,6 +42784,7 @@ type ReplicationConfigSpec struct { EncryptionDestination string `xml:"encryptionDestination,omitempty"` EncryptionPort int32 `xml:"encryptionPort,omitempty"` RemoteCertificateThumbprint string `xml:"remoteCertificateThumbprint,omitempty"` + DataSetsReplicationEnabled *bool `xml:"dataSetsReplicationEnabled"` Disk []ReplicationInfoDiskSettings `xml:"disk,omitempty"` } @@ -40005,10 +42921,10 @@ func init() { type ReplicationVmFault struct { ReplicationFault - Reason string `xml:"reason,omitempty"` - State string `xml:"state,omitempty"` - InstanceId string `xml:"instanceId,omitempty"` - Vm *ManagedObjectReference `xml:"vm,omitempty"` + Reason string `xml:"reason"` + State string `xml:"state,omitempty"` + InstanceId string `xml:"instanceId,omitempty"` + Vm ManagedObjectReference `xml:"vm"` } func init() { @@ -40430,11 +43346,12 @@ func init() { type ResourceConfigSpec struct { DynamicData - Entity *ManagedObjectReference `xml:"entity,omitempty"` - ChangeVersion string `xml:"changeVersion,omitempty"` - LastModified *time.Time `xml:"lastModified"` - CpuAllocation ResourceAllocationInfo `xml:"cpuAllocation"` - MemoryAllocation ResourceAllocationInfo `xml:"memoryAllocation"` + Entity *ManagedObjectReference `xml:"entity,omitempty"` + ChangeVersion string `xml:"changeVersion,omitempty"` + LastModified *time.Time `xml:"lastModified"` + CpuAllocation ResourceAllocationInfo `xml:"cpuAllocation"` + MemoryAllocation ResourceAllocationInfo `xml:"memoryAllocation"` + ScaleDescendantsShares string `xml:"scaleDescendantsShares,omitempty"` } func init() { @@ -40577,9 +43494,10 @@ func init() { type ResourcePoolRuntimeInfo struct { DynamicData - Memory ResourcePoolResourceUsage `xml:"memory"` - Cpu ResourcePoolResourceUsage `xml:"cpu"` - OverallStatus ManagedEntityStatus `xml:"overallStatus"` + Memory ResourcePoolResourceUsage `xml:"memory"` + Cpu ResourcePoolResourceUsage `xml:"cpu"` + OverallStatus ManagedEntityStatus `xml:"overallStatus"` + SharesScalable string `xml:"sharesScalable,omitempty"` } func init() { @@ -40861,6 +43779,24 @@ type RetrieveDiskPartitionInfoResponse struct { Returnval []HostDiskPartitionInfo `xml:"returnval,omitempty"` } +type RetrieveDynamicPassthroughInfo RetrieveDynamicPassthroughInfoRequestType + +func init() { + t["RetrieveDynamicPassthroughInfo"] = reflect.TypeOf((*RetrieveDynamicPassthroughInfo)(nil)).Elem() +} + +type RetrieveDynamicPassthroughInfoRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RetrieveDynamicPassthroughInfoRequestType"] = reflect.TypeOf((*RetrieveDynamicPassthroughInfoRequestType)(nil)).Elem() +} + +type RetrieveDynamicPassthroughInfoResponse struct { + Returnval []VirtualMachineDynamicPassthroughInfo `xml:"returnval,omitempty"` +} + type RetrieveEntityPermissions RetrieveEntityPermissionsRequestType func init() { @@ -40900,6 +43836,24 @@ type RetrieveEntityScheduledTaskResponse struct { Returnval []ManagedObjectReference `xml:"returnval,omitempty"` } +type RetrieveFreeEpcMemory RetrieveFreeEpcMemoryRequestType + +func init() { + t["RetrieveFreeEpcMemory"] = reflect.TypeOf((*RetrieveFreeEpcMemory)(nil)).Elem() +} + +type RetrieveFreeEpcMemoryRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RetrieveFreeEpcMemoryRequestType"] = reflect.TypeOf((*RetrieveFreeEpcMemoryRequestType)(nil)).Elem() +} + +type RetrieveFreeEpcMemoryResponse struct { + Returnval int64 `xml:"returnval"` +} + type RetrieveHardwareUptime RetrieveHardwareUptimeRequestType func init() { @@ -41187,6 +44141,45 @@ type RetrieveServiceContentResponse struct { Returnval ServiceContent `xml:"returnval"` } +type RetrieveServiceProviderEntities RetrieveServiceProviderEntitiesRequestType + +func init() { + t["RetrieveServiceProviderEntities"] = reflect.TypeOf((*RetrieveServiceProviderEntities)(nil)).Elem() +} + +type RetrieveServiceProviderEntitiesRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RetrieveServiceProviderEntitiesRequestType"] = reflect.TypeOf((*RetrieveServiceProviderEntitiesRequestType)(nil)).Elem() +} + +type RetrieveServiceProviderEntitiesResponse struct { + Returnval []ManagedObjectReference `xml:"returnval,omitempty"` +} + +type RetrieveSnapshotDetails RetrieveSnapshotDetailsRequestType + +func init() { + t["RetrieveSnapshotDetails"] = reflect.TypeOf((*RetrieveSnapshotDetails)(nil)).Elem() +} + +type RetrieveSnapshotDetailsRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` + SnapshotId ID `xml:"snapshotId"` +} + +func init() { + t["RetrieveSnapshotDetailsRequestType"] = reflect.TypeOf((*RetrieveSnapshotDetailsRequestType)(nil)).Elem() +} + +type RetrieveSnapshotDetailsResponse struct { + Returnval VStorageObjectSnapshotDetails `xml:"returnval"` +} + type RetrieveSnapshotInfo RetrieveSnapshotInfoRequestType func init() { @@ -41288,9 +44281,10 @@ type RetrieveVStorageObjectAssociationsResponse struct { } type RetrieveVStorageObjectRequestType struct { - This ManagedObjectReference `xml:"_this"` - Id ID `xml:"id"` - Datastore ManagedObjectReference `xml:"datastore"` + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` + DiskInfoFlags []string `xml:"diskInfoFlags,omitempty"` } func init() { @@ -41321,6 +44315,60 @@ type RetrieveVStorageObjectStateResponse struct { Returnval VStorageObjectStateInfo `xml:"returnval"` } +type RetrieveVendorDeviceGroupInfo RetrieveVendorDeviceGroupInfoRequestType + +func init() { + t["RetrieveVendorDeviceGroupInfo"] = reflect.TypeOf((*RetrieveVendorDeviceGroupInfo)(nil)).Elem() +} + +type RetrieveVendorDeviceGroupInfoRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RetrieveVendorDeviceGroupInfoRequestType"] = reflect.TypeOf((*RetrieveVendorDeviceGroupInfoRequestType)(nil)).Elem() +} + +type RetrieveVendorDeviceGroupInfoResponse struct { + Returnval []VirtualMachineVendorDeviceGroupInfo `xml:"returnval,omitempty"` +} + +type RetrieveVgpuDeviceInfo RetrieveVgpuDeviceInfoRequestType + +func init() { + t["RetrieveVgpuDeviceInfo"] = reflect.TypeOf((*RetrieveVgpuDeviceInfo)(nil)).Elem() +} + +type RetrieveVgpuDeviceInfoRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RetrieveVgpuDeviceInfoRequestType"] = reflect.TypeOf((*RetrieveVgpuDeviceInfoRequestType)(nil)).Elem() +} + +type RetrieveVgpuDeviceInfoResponse struct { + Returnval []VirtualMachineVgpuDeviceInfo `xml:"returnval,omitempty"` +} + +type RetrieveVgpuProfileInfo RetrieveVgpuProfileInfoRequestType + +func init() { + t["RetrieveVgpuProfileInfo"] = reflect.TypeOf((*RetrieveVgpuProfileInfo)(nil)).Elem() +} + +type RetrieveVgpuProfileInfoRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["RetrieveVgpuProfileInfoRequestType"] = reflect.TypeOf((*RetrieveVgpuProfileInfoRequestType)(nil)).Elem() +} + +type RetrieveVgpuProfileInfoResponse struct { + Returnval []VirtualMachineVgpuProfileInfo `xml:"returnval,omitempty"` +} + type RevertToCurrentSnapshotRequestType struct { This ManagedObjectReference `xml:"_this"` Host *ManagedObjectReference `xml:"host,omitempty"` @@ -41861,25 +44909,27 @@ func init() { type ScsiLun struct { HostDevice - Key string `xml:"key,omitempty"` - Uuid string `xml:"uuid"` - Descriptor []ScsiLunDescriptor `xml:"descriptor,omitempty"` - CanonicalName string `xml:"canonicalName,omitempty"` - DisplayName string `xml:"displayName,omitempty"` - LunType string `xml:"lunType"` - Vendor string `xml:"vendor,omitempty"` - Model string `xml:"model,omitempty"` - Revision string `xml:"revision,omitempty"` - ScsiLevel int32 `xml:"scsiLevel,omitempty"` - SerialNumber string `xml:"serialNumber,omitempty"` - DurableName *ScsiLunDurableName `xml:"durableName,omitempty"` - AlternateName []ScsiLunDurableName `xml:"alternateName,omitempty"` - StandardInquiry []byte `xml:"standardInquiry,omitempty"` - QueueDepth int32 `xml:"queueDepth,omitempty"` - OperationalState []string `xml:"operationalState"` - Capabilities *ScsiLunCapabilities `xml:"capabilities,omitempty"` - VStorageSupport string `xml:"vStorageSupport,omitempty"` - ProtocolEndpoint *bool `xml:"protocolEndpoint"` + Key string `xml:"key,omitempty"` + Uuid string `xml:"uuid"` + Descriptor []ScsiLunDescriptor `xml:"descriptor,omitempty"` + CanonicalName string `xml:"canonicalName,omitempty"` + DisplayName string `xml:"displayName,omitempty"` + LunType string `xml:"lunType"` + Vendor string `xml:"vendor,omitempty"` + Model string `xml:"model,omitempty"` + Revision string `xml:"revision,omitempty"` + ScsiLevel int32 `xml:"scsiLevel,omitempty"` + SerialNumber string `xml:"serialNumber,omitempty"` + DurableName *ScsiLunDurableName `xml:"durableName,omitempty"` + AlternateName []ScsiLunDurableName `xml:"alternateName,omitempty"` + StandardInquiry []byte `xml:"standardInquiry,omitempty"` + QueueDepth int32 `xml:"queueDepth,omitempty"` + OperationalState []string `xml:"operationalState"` + Capabilities *ScsiLunCapabilities `xml:"capabilities,omitempty"` + VStorageSupport string `xml:"vStorageSupport,omitempty"` + ProtocolEndpoint *bool `xml:"protocolEndpoint"` + PerenniallyReserved *bool `xml:"perenniallyReserved"` + ClusteredVmdkSupported *bool `xml:"clusteredVmdkSupported"` } func init() { @@ -42004,7 +45054,7 @@ func init() { type SecondaryVmAlreadyRegistered struct { VmFaultToleranceIssue - InstanceUuid string `xml:"instanceUuid,omitempty"` + InstanceUuid string `xml:"instanceUuid"` } func init() { @@ -42020,7 +45070,7 @@ func init() { type SecondaryVmNotRegistered struct { VmFaultToleranceIssue - InstanceUuid string `xml:"instanceUuid,omitempty"` + InstanceUuid string `xml:"instanceUuid"` } func init() { @@ -42244,6 +45294,7 @@ type ServiceContent struct { TaskManager *ManagedObjectReference `xml:"taskManager,omitempty"` ExtensionManager *ManagedObjectReference `xml:"extensionManager,omitempty"` CustomizationSpecManager *ManagedObjectReference `xml:"customizationSpecManager,omitempty"` + GuestCustomizationManager *ManagedObjectReference `xml:"guestCustomizationManager,omitempty"` CustomFieldsManager *ManagedObjectReference `xml:"customFieldsManager,omitempty"` AccountManager *ManagedObjectReference `xml:"accountManager,omitempty"` DiagnosticManager *ManagedObjectReference `xml:"diagnosticManager,omitempty"` @@ -42274,6 +45325,9 @@ type ServiceContent struct { HealthUpdateManager *ManagedObjectReference `xml:"healthUpdateManager,omitempty"` FailoverClusterConfigurator *ManagedObjectReference `xml:"failoverClusterConfigurator,omitempty"` FailoverClusterManager *ManagedObjectReference `xml:"failoverClusterManager,omitempty"` + TenantManager *ManagedObjectReference `xml:"tenantManager,omitempty"` + SiteInfoManager *ManagedObjectReference `xml:"siteInfoManager,omitempty"` + StorageQueryManager *ManagedObjectReference `xml:"storageQueryManager,omitempty"` } func init() { @@ -42376,9 +45430,11 @@ type SessionIsActiveResponse struct { type SessionManagerGenericServiceTicket struct { DynamicData - Id string `xml:"id"` - HostName string `xml:"hostName,omitempty"` - SslThumbprint string `xml:"sslThumbprint,omitempty"` + Id string `xml:"id"` + HostName string `xml:"hostName,omitempty"` + SslThumbprint string `xml:"sslThumbprint,omitempty"` + CertThumbprintList []VirtualMachineCertThumbprint `xml:"certThumbprintList,omitempty"` + TicketType string `xml:"ticketType,omitempty"` } func init() { @@ -42454,6 +45510,43 @@ func init() { type SetCollectorPageSizeResponse struct { } +type SetCryptoMode SetCryptoModeRequestType + +func init() { + t["SetCryptoMode"] = reflect.TypeOf((*SetCryptoMode)(nil)).Elem() +} + +type SetCryptoModeRequestType struct { + This ManagedObjectReference `xml:"_this"` + CryptoMode string `xml:"cryptoMode"` +} + +func init() { + t["SetCryptoModeRequestType"] = reflect.TypeOf((*SetCryptoModeRequestType)(nil)).Elem() +} + +type SetCryptoModeResponse struct { +} + +type SetDefaultKmsCluster SetDefaultKmsClusterRequestType + +func init() { + t["SetDefaultKmsCluster"] = reflect.TypeOf((*SetDefaultKmsCluster)(nil)).Elem() +} + +type SetDefaultKmsClusterRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity *ManagedObjectReference `xml:"entity,omitempty"` + ClusterId *KeyProviderId `xml:"clusterId,omitempty"` +} + +func init() { + t["SetDefaultKmsClusterRequestType"] = reflect.TypeOf((*SetDefaultKmsClusterRequestType)(nil)).Elem() +} + +type SetDefaultKmsClusterResponse struct { +} + type SetDisplayTopology SetDisplayTopologyRequestType func init() { @@ -42567,6 +45660,25 @@ func init() { type SetLocaleResponse struct { } +type SetMaxQueueDepth SetMaxQueueDepthRequestType + +func init() { + t["SetMaxQueueDepth"] = reflect.TypeOf((*SetMaxQueueDepth)(nil)).Elem() +} + +type SetMaxQueueDepthRequestType struct { + This ManagedObjectReference `xml:"_this"` + Datastore ManagedObjectReference `xml:"datastore"` + MaxQdepth int64 `xml:"maxQdepth"` +} + +func init() { + t["SetMaxQueueDepthRequestType"] = reflect.TypeOf((*SetMaxQueueDepthRequestType)(nil)).Elem() +} + +type SetMaxQueueDepthResponse struct { +} + type SetMultipathLunPolicy SetMultipathLunPolicyRequestType func init() { @@ -42870,6 +45982,14 @@ func init() { t["SingleMac"] = reflect.TypeOf((*SingleMac)(nil)).Elem() } +type SiteInfo struct { + DynamicData +} + +func init() { + t["SiteInfo"] = reflect.TypeOf((*SiteInfo)(nil)).Elem() +} + type SnapshotCloneNotSupported struct { SnapshotCopyNotSupported } @@ -43102,6 +46222,20 @@ func init() { t["SoftwarePackageCapability"] = reflect.TypeOf((*SoftwarePackageCapability)(nil)).Elem() } +type SolutionUserRequired struct { + SecurityError +} + +func init() { + t["SolutionUserRequired"] = reflect.TypeOf((*SolutionUserRequired)(nil)).Elem() +} + +type SolutionUserRequiredFault SolutionUserRequired + +func init() { + t["SolutionUserRequiredFault"] = reflect.TypeOf((*SolutionUserRequiredFault)(nil)).Elem() +} + type SourceNodeSpec struct { DynamicData @@ -43186,6 +46320,26 @@ func init() { type StandbyGuestResponse struct { } +type StartGuestNetworkRequestType struct { + This ManagedObjectReference `xml:"_this"` + Vm ManagedObjectReference `xml:"vm"` + Auth BaseGuestAuthentication `xml:"auth,typeattr"` +} + +func init() { + t["StartGuestNetworkRequestType"] = reflect.TypeOf((*StartGuestNetworkRequestType)(nil)).Elem() +} + +type StartGuestNetwork_Task StartGuestNetworkRequestType + +func init() { + t["StartGuestNetwork_Task"] = reflect.TypeOf((*StartGuestNetwork_Task)(nil)).Elem() +} + +type StartGuestNetwork_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + type StartProgramInGuest StartProgramInGuestRequestType func init() { @@ -44538,6 +47692,24 @@ func init() { type TerminateVMResponse struct { } +type TestTimeService TestTimeServiceRequestType + +func init() { + t["TestTimeService"] = reflect.TypeOf((*TestTimeService)(nil)).Elem() +} + +type TestTimeServiceRequestType struct { + This ManagedObjectReference `xml:"_this"` +} + +func init() { + t["TestTimeServiceRequestType"] = reflect.TypeOf((*TestTimeServiceRequestType)(nil)).Elem() +} + +type TestTimeServiceResponse struct { + Returnval *HostDateTimeSystemServiceTestResult `xml:"returnval,omitempty"` +} + type ThirdPartyLicenseAssignmentFailed struct { RuntimeFault @@ -44748,18 +47920,19 @@ func init() { type ToolsConfigInfo struct { DynamicData - ToolsVersion int32 `xml:"toolsVersion,omitempty"` - ToolsInstallType string `xml:"toolsInstallType,omitempty"` - AfterPowerOn *bool `xml:"afterPowerOn"` - AfterResume *bool `xml:"afterResume"` - BeforeGuestStandby *bool `xml:"beforeGuestStandby"` - BeforeGuestShutdown *bool `xml:"beforeGuestShutdown"` - BeforeGuestReboot *bool `xml:"beforeGuestReboot"` - ToolsUpgradePolicy string `xml:"toolsUpgradePolicy,omitempty"` - PendingCustomization string `xml:"pendingCustomization,omitempty"` - CustomizationKeyId *CryptoKeyId `xml:"customizationKeyId,omitempty"` - SyncTimeWithHost *bool `xml:"syncTimeWithHost"` - LastInstallInfo *ToolsConfigInfoToolsLastInstallInfo `xml:"lastInstallInfo,omitempty"` + ToolsVersion int32 `xml:"toolsVersion,omitempty"` + ToolsInstallType string `xml:"toolsInstallType,omitempty"` + AfterPowerOn *bool `xml:"afterPowerOn"` + AfterResume *bool `xml:"afterResume"` + BeforeGuestStandby *bool `xml:"beforeGuestStandby"` + BeforeGuestShutdown *bool `xml:"beforeGuestShutdown"` + BeforeGuestReboot *bool `xml:"beforeGuestReboot"` + ToolsUpgradePolicy string `xml:"toolsUpgradePolicy,omitempty"` + PendingCustomization string `xml:"pendingCustomization,omitempty"` + CustomizationKeyId *CryptoKeyId `xml:"customizationKeyId,omitempty"` + SyncTimeWithHostAllowed *bool `xml:"syncTimeWithHostAllowed"` + SyncTimeWithHost *bool `xml:"syncTimeWithHost"` + LastInstallInfo *ToolsConfigInfoToolsLastInstallInfo `xml:"lastInstallInfo,omitempty"` } func init() { @@ -45169,6 +48342,24 @@ type UnmapVmfsVolumeEx_TaskResponse struct { Returnval ManagedObjectReference `xml:"returnval"` } +type UnmarkServiceProviderEntities UnmarkServiceProviderEntitiesRequestType + +func init() { + t["UnmarkServiceProviderEntities"] = reflect.TypeOf((*UnmarkServiceProviderEntities)(nil)).Elem() +} + +type UnmarkServiceProviderEntitiesRequestType struct { + This ManagedObjectReference `xml:"_this"` + Entity []ManagedObjectReference `xml:"entity,omitempty"` +} + +func init() { + t["UnmarkServiceProviderEntitiesRequestType"] = reflect.TypeOf((*UnmarkServiceProviderEntitiesRequestType)(nil)).Elem() +} + +type UnmarkServiceProviderEntitiesResponse struct { +} + type UnmountDiskMappingRequestType struct { This ManagedObjectReference `xml:"_this"` Mapping []VsanHostDiskMapping `xml:"mapping"` @@ -45348,6 +48539,24 @@ func init() { type UnregisterHealthUpdateProviderResponse struct { } +type UnregisterKmsCluster UnregisterKmsClusterRequestType + +func init() { + t["UnregisterKmsCluster"] = reflect.TypeOf((*UnregisterKmsCluster)(nil)).Elem() +} + +type UnregisterKmsClusterRequestType struct { + This ManagedObjectReference `xml:"_this"` + ClusterId KeyProviderId `xml:"clusterId"` +} + +func init() { + t["UnregisterKmsClusterRequestType"] = reflect.TypeOf((*UnregisterKmsClusterRequestType)(nil)).Elem() +} + +type UnregisterKmsClusterResponse struct { +} + type UnregisterVM UnregisterVMRequestType func init() { @@ -45475,6 +48684,24 @@ type UpdateAnswerFile_TaskResponse struct { Returnval ManagedObjectReference `xml:"returnval"` } +type UpdateAssignableHardwareConfig UpdateAssignableHardwareConfigRequestType + +func init() { + t["UpdateAssignableHardwareConfig"] = reflect.TypeOf((*UpdateAssignableHardwareConfig)(nil)).Elem() +} + +type UpdateAssignableHardwareConfigRequestType struct { + This ManagedObjectReference `xml:"_this"` + Config HostAssignableHardwareConfig `xml:"config"` +} + +func init() { + t["UpdateAssignableHardwareConfigRequestType"] = reflect.TypeOf((*UpdateAssignableHardwareConfigRequestType)(nil)).Elem() +} + +type UpdateAssignableHardwareConfigResponse struct { +} + type UpdateAssignedLicense UpdateAssignedLicenseRequestType func init() { @@ -45919,6 +49146,25 @@ func init() { type UpdateHostSubSpecificationResponse struct { } +type UpdateHppMultipathLunPolicy UpdateHppMultipathLunPolicyRequestType + +func init() { + t["UpdateHppMultipathLunPolicy"] = reflect.TypeOf((*UpdateHppMultipathLunPolicy)(nil)).Elem() +} + +type UpdateHppMultipathLunPolicyRequestType struct { + This ManagedObjectReference `xml:"_this"` + LunId string `xml:"lunId"` + Policy HostMultipathInfoHppLogicalUnitPolicy `xml:"policy"` +} + +func init() { + t["UpdateHppMultipathLunPolicyRequestType"] = reflect.TypeOf((*UpdateHppMultipathLunPolicyRequestType)(nil)).Elem() +} + +type UpdateHppMultipathLunPolicyResponse struct { +} + type UpdateInternetScsiAdvancedOptions UpdateInternetScsiAdvancedOptionsRequestType func init() { @@ -46427,6 +49673,25 @@ func init() { type UpdatePortGroupResponse struct { } +type UpdateProductLockerLocationRequestType struct { + This ManagedObjectReference `xml:"_this"` + Path string `xml:"path"` +} + +func init() { + t["UpdateProductLockerLocationRequestType"] = reflect.TypeOf((*UpdateProductLockerLocationRequestType)(nil)).Elem() +} + +type UpdateProductLockerLocation_Task UpdateProductLockerLocationRequestType + +func init() { + t["UpdateProductLockerLocation_Task"] = reflect.TypeOf((*UpdateProductLockerLocation_Task)(nil)).Elem() +} + +type UpdateProductLockerLocation_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + type UpdateProgress UpdateProgressRequestType func init() { @@ -46715,6 +49980,28 @@ type UpdateVStorageInfrastructureObjectPolicy_TaskResponse struct { Returnval ManagedObjectReference `xml:"returnval"` } +type UpdateVStorageObjectCryptoRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` + Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` + DisksCrypto *DiskCryptoSpec `xml:"disksCrypto,omitempty"` +} + +func init() { + t["UpdateVStorageObjectCryptoRequestType"] = reflect.TypeOf((*UpdateVStorageObjectCryptoRequestType)(nil)).Elem() +} + +type UpdateVStorageObjectCrypto_Task UpdateVStorageObjectCryptoRequestType + +func init() { + t["UpdateVStorageObjectCrypto_Task"] = reflect.TypeOf((*UpdateVStorageObjectCrypto_Task)(nil)).Elem() +} + +type UpdateVStorageObjectCrypto_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + type UpdateVStorageObjectPolicyRequestType struct { This ManagedObjectReference `xml:"_this"` Id ID `xml:"id"` @@ -47291,16 +50578,52 @@ func init() { type VASAStorageArray struct { DynamicData - Name string `xml:"name"` - Uuid string `xml:"uuid"` - VendorId string `xml:"vendorId"` - ModelId string `xml:"modelId"` + Name string `xml:"name"` + Uuid string `xml:"uuid"` + VendorId string `xml:"vendorId"` + ModelId string `xml:"modelId"` + DiscoverySvcInfo []VASAStorageArrayDiscoverySvcInfo `xml:"discoverySvcInfo,omitempty"` } func init() { t["VASAStorageArray"] = reflect.TypeOf((*VASAStorageArray)(nil)).Elem() } +type VASAStorageArrayDiscoveryFcTransport struct { + DynamicData + + NodeWwn string `xml:"nodeWwn"` + PortWwn string `xml:"portWwn"` +} + +func init() { + t["VASAStorageArrayDiscoveryFcTransport"] = reflect.TypeOf((*VASAStorageArrayDiscoveryFcTransport)(nil)).Elem() +} + +type VASAStorageArrayDiscoveryIpTransport struct { + DynamicData + + IpAddress string `xml:"ipAddress"` + PortNumber string `xml:"portNumber,omitempty"` +} + +func init() { + t["VASAStorageArrayDiscoveryIpTransport"] = reflect.TypeOf((*VASAStorageArrayDiscoveryIpTransport)(nil)).Elem() +} + +type VASAStorageArrayDiscoverySvcInfo struct { + DynamicData + + PortType string `xml:"portType"` + SvcNqn string `xml:"svcNqn"` + IpInfo *VASAStorageArrayDiscoveryIpTransport `xml:"ipInfo,omitempty"` + FcInfo *VASAStorageArrayDiscoveryFcTransport `xml:"fcInfo,omitempty"` +} + +func init() { + t["VASAStorageArrayDiscoverySvcInfo"] = reflect.TypeOf((*VASAStorageArrayDiscoverySvcInfo)(nil)).Elem() +} + type VAppCloneSpec struct { DynamicData @@ -47559,6 +50882,28 @@ func init() { t["VAppTaskInProgressFault"] = reflect.TypeOf((*VAppTaskInProgressFault)(nil)).Elem() } +type VCenterUpdateVStorageObjectMetadataExRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` + Metadata []KeyValue `xml:"metadata,omitempty"` + DeleteKeys []string `xml:"deleteKeys,omitempty"` +} + +func init() { + t["VCenterUpdateVStorageObjectMetadataExRequestType"] = reflect.TypeOf((*VCenterUpdateVStorageObjectMetadataExRequestType)(nil)).Elem() +} + +type VCenterUpdateVStorageObjectMetadataEx_Task VCenterUpdateVStorageObjectMetadataExRequestType + +func init() { + t["VCenterUpdateVStorageObjectMetadataEx_Task"] = reflect.TypeOf((*VCenterUpdateVStorageObjectMetadataEx_Task)(nil)).Elem() +} + +type VCenterUpdateVStorageObjectMetadataEx_TaskResponse struct { + Returnval ManagedObjectReference `xml:"returnval"` +} + type VFlashCacheHotConfigNotSupported struct { VmConfigFault } @@ -47823,6 +51168,7 @@ type VMwareDVSConfigInfo struct { LacpGroupConfig []VMwareDvsLacpGroupConfig `xml:"lacpGroupConfig,omitempty"` LacpApiVersion string `xml:"lacpApiVersion,omitempty"` MulticastFilteringMode string `xml:"multicastFilteringMode,omitempty"` + NetworkOffloadSpecId string `xml:"networkOffloadSpecId,omitempty"` } func init() { @@ -47839,6 +51185,7 @@ type VMwareDVSConfigSpec struct { IpfixConfig *VMwareIpfixConfig `xml:"ipfixConfig,omitempty"` LacpApiVersion string `xml:"lacpApiVersion,omitempty"` MulticastFilteringMode string `xml:"multicastFilteringMode,omitempty"` + NetworkOffloadSpecId string `xml:"networkOffloadSpecId,omitempty"` } func init() { @@ -47855,6 +51202,9 @@ type VMwareDVSFeatureCapability struct { MulticastSnoopingSupported *bool `xml:"multicastSnoopingSupported"` VspanCapability *VMwareDVSVspanCapability `xml:"vspanCapability,omitempty"` LacpCapability *VMwareDvsLacpCapability `xml:"lacpCapability,omitempty"` + DpuCapability *VMwareDvsDpuCapability `xml:"dpuCapability,omitempty"` + NsxSupported *bool `xml:"nsxSupported"` + MtuCapability *VMwareDvsMtuCapability `xml:"mtuCapability,omitempty"` } func init() { @@ -47903,6 +51253,7 @@ type VMwareDVSPortSetting struct { TxUplink *BoolPolicy `xml:"txUplink,omitempty"` LacpPolicy *VMwareUplinkLacpPolicy `xml:"lacpPolicy,omitempty"` MacManagementPolicy *DVSMacManagementPolicy `xml:"macManagementPolicy,omitempty"` + VNI *IntPolicy `xml:"VNI,omitempty"` } func init() { @@ -47916,6 +51267,7 @@ type VMwareDVSPortgroupPolicy struct { UplinkTeamingOverrideAllowed bool `xml:"uplinkTeamingOverrideAllowed"` SecurityPolicyOverrideAllowed bool `xml:"securityPolicyOverrideAllowed"` IpfixOverrideAllowed *bool `xml:"ipfixOverrideAllowed"` + MacManagementOverrideAllowed *bool `xml:"macManagementOverrideAllowed"` } func init() { @@ -48009,6 +51361,16 @@ func init() { t["VMwareDVSVspanConfigSpec"] = reflect.TypeOf((*VMwareDVSVspanConfigSpec)(nil)).Elem() } +type VMwareDvsDpuCapability struct { + DynamicData + + NetworkOffloadSupported *bool `xml:"networkOffloadSupported"` +} + +func init() { + t["VMwareDvsDpuCapability"] = reflect.TypeOf((*VMwareDvsDpuCapability)(nil)).Elem() +} + type VMwareDvsIpfixCapability struct { DynamicData @@ -48026,6 +51388,7 @@ type VMwareDvsLacpCapability struct { LacpSupported *bool `xml:"lacpSupported"` MultiLacpGroupSupported *bool `xml:"multiLacpGroupSupported"` + LacpFastModeSupported *bool `xml:"lacpFastModeSupported"` } func init() { @@ -48044,6 +51407,7 @@ type VMwareDvsLacpGroupConfig struct { Ipfix *VMwareDvsLagIpfixConfig `xml:"ipfix,omitempty"` UplinkName []string `xml:"uplinkName,omitempty"` UplinkPortKey []string `xml:"uplinkPortKey,omitempty"` + TimeoutMode string `xml:"timeoutMode,omitempty"` } func init() { @@ -48081,6 +51445,17 @@ func init() { t["VMwareDvsLagVlanConfig"] = reflect.TypeOf((*VMwareDvsLagVlanConfig)(nil)).Elem() } +type VMwareDvsMtuCapability struct { + DynamicData + + MinMtuSupported int32 `xml:"minMtuSupported"` + MaxMtuSupported int32 `xml:"maxMtuSupported"` +} + +func init() { + t["VMwareDvsMtuCapability"] = reflect.TypeOf((*VMwareDvsMtuCapability)(nil)).Elem() +} + type VMwareIpfixConfig struct { DynamicData @@ -48226,6 +51601,17 @@ type VStorageObjectCreateSnapshot_TaskResponse struct { Returnval ManagedObjectReference `xml:"returnval"` } +type VStorageObjectSnapshotDetails struct { + DynamicData + + Path string `xml:"path,omitempty"` + ChangedBlockTrackingId string `xml:"changedBlockTrackingId,omitempty"` +} + +func init() { + t["VStorageObjectSnapshotDetails"] = reflect.TypeOf((*VStorageObjectSnapshotDetails)(nil)).Elem() +} + type VStorageObjectSnapshotInfo struct { DynamicData @@ -48285,6 +51671,7 @@ type VVolVmConfigFileUpdateResultFailedVmConfigFileInfo struct { DynamicData TargetConfigVVolId string `xml:"targetConfigVVolId"` + DsPath string `xml:"dsPath,omitempty"` Fault LocalizedMethodFault `xml:"fault"` } @@ -48311,6 +51698,26 @@ func init() { type ValidateCredentialsInGuestResponse struct { } +type ValidateHCIConfiguration ValidateHCIConfigurationRequestType + +func init() { + t["ValidateHCIConfiguration"] = reflect.TypeOf((*ValidateHCIConfiguration)(nil)).Elem() +} + +type ValidateHCIConfigurationRequestType struct { + This ManagedObjectReference `xml:"_this"` + HciConfigSpec *ClusterComputeResourceHCIConfigSpec `xml:"hciConfigSpec,omitempty"` + Hosts []ManagedObjectReference `xml:"hosts,omitempty"` +} + +func init() { + t["ValidateHCIConfigurationRequestType"] = reflect.TypeOf((*ValidateHCIConfigurationRequestType)(nil)).Elem() +} + +type ValidateHCIConfigurationResponse struct { + Returnval []BaseClusterComputeResourceValidationResultBase `xml:"returnval,omitempty,typeattr"` +} + type ValidateHost ValidateHostRequestType func init() { @@ -48789,13 +52196,15 @@ func init() { type VirtualDevice struct { DynamicData - Key int32 `xml:"key"` - DeviceInfo BaseDescription `xml:"deviceInfo,omitempty,typeattr"` - Backing BaseVirtualDeviceBackingInfo `xml:"backing,omitempty,typeattr"` - Connectable *VirtualDeviceConnectInfo `xml:"connectable,omitempty"` - SlotInfo BaseVirtualDeviceBusSlotInfo `xml:"slotInfo,omitempty,typeattr"` - ControllerKey int32 `xml:"controllerKey,omitempty"` - UnitNumber *int32 `xml:"unitNumber"` + Key int32 `xml:"key"` + DeviceInfo BaseDescription `xml:"deviceInfo,omitempty,typeattr"` + Backing BaseVirtualDeviceBackingInfo `xml:"backing,omitempty,typeattr"` + Connectable *VirtualDeviceConnectInfo `xml:"connectable,omitempty"` + SlotInfo BaseVirtualDeviceBusSlotInfo `xml:"slotInfo,omitempty,typeattr"` + ControllerKey int32 `xml:"controllerKey,omitempty"` + UnitNumber *int32 `xml:"unitNumber"` + NumaNode int32 `xml:"numaNode,omitempty"` + DeviceGroupInfo *VirtualDeviceDeviceGroupInfo `xml:"deviceGroupInfo,omitempty"` } func init() { @@ -48841,11 +52250,13 @@ func init() { type VirtualDeviceConfigSpec struct { DynamicData - Operation VirtualDeviceConfigSpecOperation `xml:"operation,omitempty"` - FileOperation VirtualDeviceConfigSpecFileOperation `xml:"fileOperation,omitempty"` - Device BaseVirtualDevice `xml:"device,typeattr"` - Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` - Backing *VirtualDeviceConfigSpecBackingSpec `xml:"backing,omitempty"` + Operation VirtualDeviceConfigSpecOperation `xml:"operation,omitempty"` + FileOperation VirtualDeviceConfigSpecFileOperation `xml:"fileOperation,omitempty"` + Device BaseVirtualDevice `xml:"device,typeattr"` + Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` + Backing *VirtualDeviceConfigSpecBackingSpec `xml:"backing,omitempty"` + FilterSpec []BaseVirtualMachineBaseIndependentFilterSpec `xml:"filterSpec,omitempty,typeattr"` + ChangeMode string `xml:"changeMode,omitempty"` } func init() { @@ -48909,6 +52320,17 @@ func init() { t["VirtualDeviceDeviceBackingOption"] = reflect.TypeOf((*VirtualDeviceDeviceBackingOption)(nil)).Elem() } +type VirtualDeviceDeviceGroupInfo struct { + DynamicData + + GroupInstanceKey int32 `xml:"groupInstanceKey"` + SequenceId int32 `xml:"sequenceId"` +} + +func init() { + t["VirtualDeviceDeviceGroupInfo"] = reflect.TypeOf((*VirtualDeviceDeviceGroupInfo)(nil)).Elem() +} + type VirtualDeviceFileBackingInfo struct { VirtualDeviceBackingInfo @@ -48945,6 +52367,7 @@ type VirtualDeviceOption struct { Deprecated bool `xml:"deprecated"` PlugAndPlay bool `xml:"plugAndPlay"` HotRemoveSupported *bool `xml:"hotRemoveSupported"` + NumaSupported *bool `xml:"numaSupported"` } func init() { @@ -49025,15 +52448,16 @@ func init() { type VirtualDisk struct { VirtualDevice - CapacityInKB int64 `xml:"capacityInKB"` - CapacityInBytes int64 `xml:"capacityInBytes,omitempty"` - Shares *SharesInfo `xml:"shares,omitempty"` - StorageIOAllocation *StorageIOAllocationInfo `xml:"storageIOAllocation,omitempty"` - DiskObjectId string `xml:"diskObjectId,omitempty"` - VFlashCacheConfigInfo *VirtualDiskVFlashCacheConfigInfo `xml:"vFlashCacheConfigInfo,omitempty"` - Iofilter []string `xml:"iofilter,omitempty"` - VDiskId *ID `xml:"vDiskId,omitempty"` - NativeUnmanagedLinkedClone *bool `xml:"nativeUnmanagedLinkedClone"` + CapacityInKB int64 `xml:"capacityInKB"` + CapacityInBytes int64 `xml:"capacityInBytes,omitempty"` + Shares *SharesInfo `xml:"shares,omitempty"` + StorageIOAllocation *StorageIOAllocationInfo `xml:"storageIOAllocation,omitempty"` + DiskObjectId string `xml:"diskObjectId,omitempty"` + VFlashCacheConfigInfo *VirtualDiskVFlashCacheConfigInfo `xml:"vFlashCacheConfigInfo,omitempty"` + Iofilter []string `xml:"iofilter,omitempty"` + VDiskId *ID `xml:"vDiskId,omitempty"` + NativeUnmanagedLinkedClone *bool `xml:"nativeUnmanagedLinkedClone"` + IndependentFilters []BaseVirtualMachineBaseIndependentFilterSpec `xml:"independentFilters,omitempty,typeattr"` } func init() { @@ -49684,10 +53108,13 @@ type VirtualHardware struct { NumCPU int32 `xml:"numCPU"` NumCoresPerSocket int32 `xml:"numCoresPerSocket,omitempty"` + AutoCoresPerSocket *bool `xml:"autoCoresPerSocket"` MemoryMB int32 `xml:"memoryMB"` VirtualICH7MPresent *bool `xml:"virtualICH7MPresent"` VirtualSMCPresent *bool `xml:"virtualSMCPresent"` Device []BaseVirtualDevice `xml:"device,omitempty,typeattr"` + MotherboardLayout string `xml:"motherboardLayout,omitempty"` + SimultaneousThreads int32 `xml:"simultaneousThreads,omitempty"` } func init() { @@ -49711,25 +53138,34 @@ func init() { type VirtualHardwareOption struct { DynamicData - HwVersion int32 `xml:"hwVersion"` - VirtualDeviceOption []BaseVirtualDeviceOption `xml:"virtualDeviceOption,typeattr"` - DeviceListReadonly bool `xml:"deviceListReadonly"` - NumCPU []int32 `xml:"numCPU"` - NumCoresPerSocket *IntOption `xml:"numCoresPerSocket,omitempty"` - NumCpuReadonly bool `xml:"numCpuReadonly"` - MemoryMB LongOption `xml:"memoryMB"` - NumPCIControllers IntOption `xml:"numPCIControllers"` - NumIDEControllers IntOption `xml:"numIDEControllers"` - NumUSBControllers IntOption `xml:"numUSBControllers"` - NumUSBXHCIControllers *IntOption `xml:"numUSBXHCIControllers,omitempty"` - NumSIOControllers IntOption `xml:"numSIOControllers"` - NumPS2Controllers IntOption `xml:"numPS2Controllers"` - LicensingLimit []string `xml:"licensingLimit,omitempty"` - NumSupportedWwnPorts *IntOption `xml:"numSupportedWwnPorts,omitempty"` - NumSupportedWwnNodes *IntOption `xml:"numSupportedWwnNodes,omitempty"` - ResourceConfigOption *ResourceConfigOption `xml:"resourceConfigOption,omitempty"` - NumNVDIMMControllers *IntOption `xml:"numNVDIMMControllers,omitempty"` - NumTPMDevices *IntOption `xml:"numTPMDevices,omitempty"` + HwVersion int32 `xml:"hwVersion"` + VirtualDeviceOption []BaseVirtualDeviceOption `xml:"virtualDeviceOption,typeattr"` + DeviceListReadonly bool `xml:"deviceListReadonly"` + NumCPU []int32 `xml:"numCPU"` + NumCoresPerSocket *IntOption `xml:"numCoresPerSocket,omitempty"` + AutoCoresPerSocket *BoolOption `xml:"autoCoresPerSocket,omitempty"` + NumCpuReadonly bool `xml:"numCpuReadonly"` + MemoryMB LongOption `xml:"memoryMB"` + NumPCIControllers IntOption `xml:"numPCIControllers"` + NumIDEControllers IntOption `xml:"numIDEControllers"` + NumUSBControllers IntOption `xml:"numUSBControllers"` + NumUSBXHCIControllers *IntOption `xml:"numUSBXHCIControllers,omitempty"` + NumSIOControllers IntOption `xml:"numSIOControllers"` + NumPS2Controllers IntOption `xml:"numPS2Controllers"` + LicensingLimit []string `xml:"licensingLimit,omitempty"` + NumSupportedWwnPorts *IntOption `xml:"numSupportedWwnPorts,omitempty"` + NumSupportedWwnNodes *IntOption `xml:"numSupportedWwnNodes,omitempty"` + ResourceConfigOption *ResourceConfigOption `xml:"resourceConfigOption,omitempty"` + NumNVDIMMControllers *IntOption `xml:"numNVDIMMControllers,omitempty"` + NumTPMDevices *IntOption `xml:"numTPMDevices,omitempty"` + NumWDTDevices *IntOption `xml:"numWDTDevices,omitempty"` + NumPrecisionClockDevices *IntOption `xml:"numPrecisionClockDevices,omitempty"` + EpcMemoryMB *LongOption `xml:"epcMemoryMB,omitempty"` + AcpiHostBridgesFirmware []string `xml:"acpiHostBridgesFirmware,omitempty"` + NumCpuSimultaneousThreads *IntOption `xml:"numCpuSimultaneousThreads,omitempty"` + NumNumaNodes *IntOption `xml:"numNumaNodes,omitempty"` + NumDeviceGroups *IntOption `xml:"numDeviceGroups,omitempty"` + DeviceGroupTypes []string `xml:"deviceGroupTypes,omitempty"` } func init() { @@ -49846,6 +53282,14 @@ func init() { t["VirtualMachineAffinityInfo"] = reflect.TypeOf((*VirtualMachineAffinityInfo)(nil)).Elem() } +type VirtualMachineBaseIndependentFilterSpec struct { + DynamicData +} + +func init() { + t["VirtualMachineBaseIndependentFilterSpec"] = reflect.TypeOf((*VirtualMachineBaseIndependentFilterSpec)(nil)).Elem() +} + type VirtualMachineBootOptions struct { DynamicData @@ -49951,6 +53395,12 @@ type VirtualMachineCapability struct { VirtualMmuUsageIgnored *bool `xml:"virtualMmuUsageIgnored"` VirtualExecUsageIgnored *bool `xml:"virtualExecUsageIgnored"` DiskOnlySnapshotOnSuspendedVMSupported *bool `xml:"diskOnlySnapshotOnSuspendedVMSupported"` + SuspendToMemorySupported *bool `xml:"suspendToMemorySupported"` + ToolsSyncTimeAllowSupported *bool `xml:"toolsSyncTimeAllowSupported"` + SevSupported *bool `xml:"sevSupported"` + PmemFailoverSupported *bool `xml:"pmemFailoverSupported"` + RequireSgxAttestationSupported *bool `xml:"requireSgxAttestationSupported"` + ChangeModeDisksSupported *bool `xml:"changeModeDisksSupported"` } func init() { @@ -49967,16 +53417,28 @@ func init() { t["VirtualMachineCdromInfo"] = reflect.TypeOf((*VirtualMachineCdromInfo)(nil)).Elem() } +type VirtualMachineCertThumbprint struct { + DynamicData + + Thumbprint string `xml:"thumbprint"` + HashAlgorithm string `xml:"hashAlgorithm,omitempty"` +} + +func init() { + t["VirtualMachineCertThumbprint"] = reflect.TypeOf((*VirtualMachineCertThumbprint)(nil)).Elem() +} + type VirtualMachineCloneSpec struct { DynamicData - Location VirtualMachineRelocateSpec `xml:"location"` - Template bool `xml:"template"` - Config *VirtualMachineConfigSpec `xml:"config,omitempty"` - Customization *CustomizationSpec `xml:"customization,omitempty"` - PowerOn bool `xml:"powerOn"` - Snapshot *ManagedObjectReference `xml:"snapshot,omitempty"` - Memory *bool `xml:"memory"` + Location VirtualMachineRelocateSpec `xml:"location"` + Template bool `xml:"template"` + Config *VirtualMachineConfigSpec `xml:"config,omitempty"` + Customization *CustomizationSpec `xml:"customization,omitempty"` + PowerOn bool `xml:"powerOn"` + Snapshot *ManagedObjectReference `xml:"snapshot,omitempty"` + Memory *bool `xml:"memory"` + TpmProvisionPolicy string `xml:"tpmProvisionPolicy,omitempty"` } func init() { @@ -50011,7 +53473,9 @@ type VirtualMachineConfigInfo struct { Flags VirtualMachineFlagInfo `xml:"flags"` ConsolePreferences *VirtualMachineConsolePreferences `xml:"consolePreferences,omitempty"` DefaultPowerOps VirtualMachineDefaultPowerOpInfo `xml:"defaultPowerOps"` + RebootPowerOff *bool `xml:"rebootPowerOff"` Hardware VirtualHardware `xml:"hardware"` + VcpuConfig []VirtualMachineVcpuConfig `xml:"vcpuConfig,omitempty"` CpuAllocation *ResourceAllocationInfo `xml:"cpuAllocation,omitempty"` MemoryAllocation *ResourceAllocationInfo `xml:"memoryAllocation,omitempty"` LatencySensitivity *LatencySensitivity `xml:"latencySensitivity,omitempty"` @@ -50051,6 +53515,19 @@ type VirtualMachineConfigInfo struct { KeyId *CryptoKeyId `xml:"keyId,omitempty"` GuestIntegrityInfo *VirtualMachineGuestIntegrityInfo `xml:"guestIntegrityInfo,omitempty"` MigrateEncryption string `xml:"migrateEncryption,omitempty"` + SgxInfo *VirtualMachineSgxInfo `xml:"sgxInfo,omitempty"` + ContentLibItemInfo *VirtualMachineContentLibraryItemInfo `xml:"contentLibItemInfo,omitempty"` + FtEncryptionMode string `xml:"ftEncryptionMode,omitempty"` + GuestMonitoringModeInfo *VirtualMachineGuestMonitoringModeInfo `xml:"guestMonitoringModeInfo,omitempty"` + SevEnabled *bool `xml:"sevEnabled"` + NumaInfo *VirtualMachineVirtualNumaInfo `xml:"numaInfo,omitempty"` + PmemFailoverEnabled *bool `xml:"pmemFailoverEnabled"` + VmxStatsCollectionEnabled *bool `xml:"vmxStatsCollectionEnabled"` + VmOpNotificationToAppEnabled *bool `xml:"vmOpNotificationToAppEnabled"` + VmOpNotificationTimeout int64 `xml:"vmOpNotificationTimeout,omitempty"` + DeviceSwap *VirtualMachineVirtualDeviceSwap `xml:"deviceSwap,omitempty"` + Pmem *VirtualMachineVirtualPMem `xml:"pmem,omitempty"` + DeviceGroups *VirtualMachineVirtualDeviceGroups `xml:"deviceGroups,omitempty"` } func init() { @@ -50119,66 +53596,82 @@ func init() { type VirtualMachineConfigSpec struct { DynamicData - ChangeVersion string `xml:"changeVersion,omitempty"` - Name string `xml:"name,omitempty"` - Version string `xml:"version,omitempty"` - CreateDate *time.Time `xml:"createDate"` - Uuid string `xml:"uuid,omitempty"` - InstanceUuid string `xml:"instanceUuid,omitempty"` - NpivNodeWorldWideName []int64 `xml:"npivNodeWorldWideName,omitempty"` - NpivPortWorldWideName []int64 `xml:"npivPortWorldWideName,omitempty"` - NpivWorldWideNameType string `xml:"npivWorldWideNameType,omitempty"` - NpivDesiredNodeWwns int16 `xml:"npivDesiredNodeWwns,omitempty"` - NpivDesiredPortWwns int16 `xml:"npivDesiredPortWwns,omitempty"` - NpivTemporaryDisabled *bool `xml:"npivTemporaryDisabled"` - NpivOnNonRdmDisks *bool `xml:"npivOnNonRdmDisks"` - NpivWorldWideNameOp string `xml:"npivWorldWideNameOp,omitempty"` - LocationId string `xml:"locationId,omitempty"` - GuestId string `xml:"guestId,omitempty"` - AlternateGuestName string `xml:"alternateGuestName,omitempty"` - Annotation string `xml:"annotation,omitempty"` - Files *VirtualMachineFileInfo `xml:"files,omitempty"` - Tools *ToolsConfigInfo `xml:"tools,omitempty"` - Flags *VirtualMachineFlagInfo `xml:"flags,omitempty"` - ConsolePreferences *VirtualMachineConsolePreferences `xml:"consolePreferences,omitempty"` - PowerOpInfo *VirtualMachineDefaultPowerOpInfo `xml:"powerOpInfo,omitempty"` - NumCPUs int32 `xml:"numCPUs,omitempty"` - NumCoresPerSocket int32 `xml:"numCoresPerSocket,omitempty"` - MemoryMB int64 `xml:"memoryMB,omitempty"` - MemoryHotAddEnabled *bool `xml:"memoryHotAddEnabled"` - CpuHotAddEnabled *bool `xml:"cpuHotAddEnabled"` - CpuHotRemoveEnabled *bool `xml:"cpuHotRemoveEnabled"` - VirtualICH7MPresent *bool `xml:"virtualICH7MPresent"` - VirtualSMCPresent *bool `xml:"virtualSMCPresent"` - DeviceChange []BaseVirtualDeviceConfigSpec `xml:"deviceChange,omitempty,typeattr"` - CpuAllocation *ResourceAllocationInfo `xml:"cpuAllocation,omitempty"` - MemoryAllocation *ResourceAllocationInfo `xml:"memoryAllocation,omitempty"` - LatencySensitivity *LatencySensitivity `xml:"latencySensitivity,omitempty"` - CpuAffinity *VirtualMachineAffinityInfo `xml:"cpuAffinity,omitempty"` - MemoryAffinity *VirtualMachineAffinityInfo `xml:"memoryAffinity,omitempty"` - NetworkShaper *VirtualMachineNetworkShaperInfo `xml:"networkShaper,omitempty"` - CpuFeatureMask []VirtualMachineCpuIdInfoSpec `xml:"cpuFeatureMask,omitempty"` - ExtraConfig []BaseOptionValue `xml:"extraConfig,omitempty,typeattr"` - SwapPlacement string `xml:"swapPlacement,omitempty"` - BootOptions *VirtualMachineBootOptions `xml:"bootOptions,omitempty"` - VAppConfig BaseVmConfigSpec `xml:"vAppConfig,omitempty,typeattr"` - FtInfo BaseFaultToleranceConfigInfo `xml:"ftInfo,omitempty,typeattr"` - RepConfig *ReplicationConfigSpec `xml:"repConfig,omitempty"` - VAppConfigRemoved *bool `xml:"vAppConfigRemoved"` - VAssertsEnabled *bool `xml:"vAssertsEnabled"` - ChangeTrackingEnabled *bool `xml:"changeTrackingEnabled"` - Firmware string `xml:"firmware,omitempty"` - MaxMksConnections int32 `xml:"maxMksConnections,omitempty"` - GuestAutoLockEnabled *bool `xml:"guestAutoLockEnabled"` - ManagedBy *ManagedByInfo `xml:"managedBy,omitempty"` - MemoryReservationLockedToMax *bool `xml:"memoryReservationLockedToMax"` - NestedHVEnabled *bool `xml:"nestedHVEnabled"` - VPMCEnabled *bool `xml:"vPMCEnabled"` - ScheduledHardwareUpgradeInfo *ScheduledHardwareUpgradeInfo `xml:"scheduledHardwareUpgradeInfo,omitempty"` - VmProfile []BaseVirtualMachineProfileSpec `xml:"vmProfile,omitempty,typeattr"` - MessageBusTunnelEnabled *bool `xml:"messageBusTunnelEnabled"` - Crypto BaseCryptoSpec `xml:"crypto,omitempty,typeattr"` - MigrateEncryption string `xml:"migrateEncryption,omitempty"` + ChangeVersion string `xml:"changeVersion,omitempty"` + Name string `xml:"name,omitempty"` + Version string `xml:"version,omitempty"` + CreateDate *time.Time `xml:"createDate"` + Uuid string `xml:"uuid,omitempty"` + InstanceUuid string `xml:"instanceUuid,omitempty"` + NpivNodeWorldWideName []int64 `xml:"npivNodeWorldWideName,omitempty"` + NpivPortWorldWideName []int64 `xml:"npivPortWorldWideName,omitempty"` + NpivWorldWideNameType string `xml:"npivWorldWideNameType,omitempty"` + NpivDesiredNodeWwns int16 `xml:"npivDesiredNodeWwns,omitempty"` + NpivDesiredPortWwns int16 `xml:"npivDesiredPortWwns,omitempty"` + NpivTemporaryDisabled *bool `xml:"npivTemporaryDisabled"` + NpivOnNonRdmDisks *bool `xml:"npivOnNonRdmDisks"` + NpivWorldWideNameOp string `xml:"npivWorldWideNameOp,omitempty"` + LocationId string `xml:"locationId,omitempty"` + GuestId string `xml:"guestId,omitempty"` + AlternateGuestName string `xml:"alternateGuestName,omitempty"` + Annotation string `xml:"annotation,omitempty"` + Files *VirtualMachineFileInfo `xml:"files,omitempty"` + Tools *ToolsConfigInfo `xml:"tools,omitempty"` + Flags *VirtualMachineFlagInfo `xml:"flags,omitempty"` + ConsolePreferences *VirtualMachineConsolePreferences `xml:"consolePreferences,omitempty"` + PowerOpInfo *VirtualMachineDefaultPowerOpInfo `xml:"powerOpInfo,omitempty"` + RebootPowerOff *bool `xml:"rebootPowerOff"` + NumCPUs int32 `xml:"numCPUs,omitempty"` + VcpuConfig []VirtualMachineVcpuConfig `xml:"vcpuConfig,omitempty"` + NumCoresPerSocket int32 `xml:"numCoresPerSocket,omitempty"` + MemoryMB int64 `xml:"memoryMB,omitempty"` + MemoryHotAddEnabled *bool `xml:"memoryHotAddEnabled"` + CpuHotAddEnabled *bool `xml:"cpuHotAddEnabled"` + CpuHotRemoveEnabled *bool `xml:"cpuHotRemoveEnabled"` + VirtualICH7MPresent *bool `xml:"virtualICH7MPresent"` + VirtualSMCPresent *bool `xml:"virtualSMCPresent"` + DeviceChange []BaseVirtualDeviceConfigSpec `xml:"deviceChange,omitempty,typeattr"` + CpuAllocation *ResourceAllocationInfo `xml:"cpuAllocation,omitempty"` + MemoryAllocation *ResourceAllocationInfo `xml:"memoryAllocation,omitempty"` + LatencySensitivity *LatencySensitivity `xml:"latencySensitivity,omitempty"` + CpuAffinity *VirtualMachineAffinityInfo `xml:"cpuAffinity,omitempty"` + MemoryAffinity *VirtualMachineAffinityInfo `xml:"memoryAffinity,omitempty"` + NetworkShaper *VirtualMachineNetworkShaperInfo `xml:"networkShaper,omitempty"` + CpuFeatureMask []VirtualMachineCpuIdInfoSpec `xml:"cpuFeatureMask,omitempty"` + ExtraConfig []BaseOptionValue `xml:"extraConfig,omitempty,typeattr"` + SwapPlacement string `xml:"swapPlacement,omitempty"` + BootOptions *VirtualMachineBootOptions `xml:"bootOptions,omitempty"` + VAppConfig BaseVmConfigSpec `xml:"vAppConfig,omitempty,typeattr"` + FtInfo BaseFaultToleranceConfigInfo `xml:"ftInfo,omitempty,typeattr"` + RepConfig *ReplicationConfigSpec `xml:"repConfig,omitempty"` + VAppConfigRemoved *bool `xml:"vAppConfigRemoved"` + VAssertsEnabled *bool `xml:"vAssertsEnabled"` + ChangeTrackingEnabled *bool `xml:"changeTrackingEnabled"` + Firmware string `xml:"firmware,omitempty"` + MaxMksConnections int32 `xml:"maxMksConnections,omitempty"` + GuestAutoLockEnabled *bool `xml:"guestAutoLockEnabled"` + ManagedBy *ManagedByInfo `xml:"managedBy,omitempty"` + MemoryReservationLockedToMax *bool `xml:"memoryReservationLockedToMax"` + NestedHVEnabled *bool `xml:"nestedHVEnabled"` + VPMCEnabled *bool `xml:"vPMCEnabled"` + ScheduledHardwareUpgradeInfo *ScheduledHardwareUpgradeInfo `xml:"scheduledHardwareUpgradeInfo,omitempty"` + VmProfile []BaseVirtualMachineProfileSpec `xml:"vmProfile,omitempty,typeattr"` + MessageBusTunnelEnabled *bool `xml:"messageBusTunnelEnabled"` + Crypto BaseCryptoSpec `xml:"crypto,omitempty,typeattr"` + MigrateEncryption string `xml:"migrateEncryption,omitempty"` + SgxInfo *VirtualMachineSgxInfo `xml:"sgxInfo,omitempty"` + FtEncryptionMode string `xml:"ftEncryptionMode,omitempty"` + GuestMonitoringModeInfo *VirtualMachineGuestMonitoringModeInfo `xml:"guestMonitoringModeInfo,omitempty"` + SevEnabled *bool `xml:"sevEnabled"` + VirtualNuma *VirtualMachineVirtualNuma `xml:"virtualNuma,omitempty"` + MotherboardLayout string `xml:"motherboardLayout,omitempty"` + PmemFailoverEnabled *bool `xml:"pmemFailoverEnabled"` + VmxStatsCollectionEnabled *bool `xml:"vmxStatsCollectionEnabled"` + VmOpNotificationToAppEnabled *bool `xml:"vmOpNotificationToAppEnabled"` + VmOpNotificationTimeout int64 `xml:"vmOpNotificationTimeout,omitempty"` + DeviceSwap *VirtualMachineVirtualDeviceSwap `xml:"deviceSwap,omitempty"` + SimultaneousThreads int32 `xml:"simultaneousThreads,omitempty"` + Pmem *VirtualMachineVirtualPMem `xml:"pmem,omitempty"` + DeviceGroups *VirtualMachineVirtualDeviceGroups `xml:"deviceGroups,omitempty"` } func init() { @@ -50208,12 +53701,25 @@ type VirtualMachineConfigSummary struct { ManagedBy *ManagedByInfo `xml:"managedBy,omitempty"` TpmPresent *bool `xml:"tpmPresent"` NumVmiopBackings int32 `xml:"numVmiopBackings,omitempty"` + HwVersion string `xml:"hwVersion,omitempty"` } func init() { t["VirtualMachineConfigSummary"] = reflect.TypeOf((*VirtualMachineConfigSummary)(nil)).Elem() } +type VirtualMachineConnection struct { + DynamicData + + Label string `xml:"label"` + Client string `xml:"client"` + UserName string `xml:"userName"` +} + +func init() { + t["VirtualMachineConnection"] = reflect.TypeOf((*VirtualMachineConnection)(nil)).Elem() +} + type VirtualMachineConsolePreferences struct { DynamicData @@ -50226,6 +53732,17 @@ func init() { t["VirtualMachineConsolePreferences"] = reflect.TypeOf((*VirtualMachineConsolePreferences)(nil)).Elem() } +type VirtualMachineContentLibraryItemInfo struct { + DynamicData + + ContentLibraryItemUuid string `xml:"contentLibraryItemUuid"` + ContentLibraryItemVersion string `xml:"contentLibraryItemVersion,omitempty"` +} + +func init() { + t["VirtualMachineContentLibraryItemInfo"] = reflect.TypeOf((*VirtualMachineContentLibraryItemInfo)(nil)).Elem() +} + type VirtualMachineCpuIdInfoSpec struct { ArrayUpdateSpec @@ -50327,6 +53844,9 @@ type VirtualMachineDeviceRuntimeInfoVirtualEthernetCardRuntimeState struct { VmDirectPathGen2InactiveReasonVm []string `xml:"vmDirectPathGen2InactiveReasonVm,omitempty"` VmDirectPathGen2InactiveReasonOther []string `xml:"vmDirectPathGen2InactiveReasonOther,omitempty"` VmDirectPathGen2InactiveReasonExtended string `xml:"vmDirectPathGen2InactiveReasonExtended,omitempty"` + Uptv2Active *bool `xml:"uptv2Active"` + Uptv2InactiveReasonVm []string `xml:"uptv2InactiveReasonVm,omitempty"` + Uptv2InactiveReasonOther []string `xml:"uptv2InactiveReasonOther,omitempty"` ReservationStatus string `xml:"reservationStatus,omitempty"` AttachmentStatus string `xml:"attachmentStatus,omitempty"` FeatureRequirement []VirtualMachineFeatureRequirement `xml:"featureRequirement,omitempty"` @@ -50360,6 +53880,41 @@ func init() { t["VirtualMachineDisplayTopology"] = reflect.TypeOf((*VirtualMachineDisplayTopology)(nil)).Elem() } +type VirtualMachineDvxClassInfo struct { + DynamicData + + DeviceClass BaseElementDescription `xml:"deviceClass,typeattr"` + VendorName string `xml:"vendorName"` + SriovNic bool `xml:"sriovNic"` + ConfigParams []OptionDef `xml:"configParams,omitempty"` +} + +func init() { + t["VirtualMachineDvxClassInfo"] = reflect.TypeOf((*VirtualMachineDvxClassInfo)(nil)).Elem() +} + +type VirtualMachineDynamicPassthroughInfo struct { + VirtualMachineTargetInfo + + VendorName string `xml:"vendorName"` + DeviceName string `xml:"deviceName"` + CustomLabel string `xml:"customLabel,omitempty"` + VendorId int32 `xml:"vendorId"` + DeviceId int32 `xml:"deviceId"` +} + +func init() { + t["VirtualMachineDynamicPassthroughInfo"] = reflect.TypeOf((*VirtualMachineDynamicPassthroughInfo)(nil)).Elem() +} + +type VirtualMachineEmptyIndependentFilterSpec struct { + VirtualMachineBaseIndependentFilterSpec +} + +func init() { + t["VirtualMachineEmptyIndependentFilterSpec"] = reflect.TypeOf((*VirtualMachineEmptyIndependentFilterSpec)(nil)).Elem() +} + type VirtualMachineEmptyProfileSpec struct { VirtualMachineProfileSpec } @@ -50550,6 +54105,17 @@ func init() { t["VirtualMachineGuestIntegrityInfo"] = reflect.TypeOf((*VirtualMachineGuestIntegrityInfo)(nil)).Elem() } +type VirtualMachineGuestMonitoringModeInfo struct { + DynamicData + + GmmFile string `xml:"gmmFile,omitempty"` + GmmAppliance string `xml:"gmmAppliance,omitempty"` +} + +func init() { + t["VirtualMachineGuestMonitoringModeInfo"] = reflect.TypeOf((*VirtualMachineGuestMonitoringModeInfo)(nil)).Elem() +} + type VirtualMachineGuestQuiesceSpec struct { DynamicData @@ -50571,6 +54137,7 @@ type VirtualMachineGuestSummary struct { ToolsRunningStatus string `xml:"toolsRunningStatus,omitempty"` HostName string `xml:"hostName,omitempty"` IpAddress string `xml:"ipAddress,omitempty"` + HwVersion string `xml:"hwVersion,omitempty"` } func init() { @@ -50609,6 +54176,18 @@ func init() { t["VirtualMachineImportSpec"] = reflect.TypeOf((*VirtualMachineImportSpec)(nil)).Elem() } +type VirtualMachineIndependentFilterSpec struct { + VirtualMachineBaseIndependentFilterSpec + + FilterName string `xml:"filterName"` + FilterClass string `xml:"filterClass,omitempty"` + FilterCapabilities []KeyValue `xml:"filterCapabilities,omitempty"` +} + +func init() { + t["VirtualMachineIndependentFilterSpec"] = reflect.TypeOf((*VirtualMachineIndependentFilterSpec)(nil)).Elem() +} + type VirtualMachineInstantCloneSpec struct { DynamicData @@ -50711,6 +54290,14 @@ func init() { t["VirtualMachineMetadataManagerVmMetadataResult"] = reflect.TypeOf((*VirtualMachineMetadataManagerVmMetadataResult)(nil)).Elem() } +type VirtualMachineMksConnection struct { + VirtualMachineConnection +} + +func init() { + t["VirtualMachineMksConnection"] = reflect.TypeOf((*VirtualMachineMksConnection)(nil)).Elem() +} + type VirtualMachineMksTicket struct { DynamicData @@ -50778,6 +54365,16 @@ func init() { t["VirtualMachinePciSharedGpuPassthroughInfo"] = reflect.TypeOf((*VirtualMachinePciSharedGpuPassthroughInfo)(nil)).Elem() } +type VirtualMachinePrecisionClockInfo struct { + VirtualMachineTargetInfo + + SystemClockProtocol string `xml:"systemClockProtocol,omitempty"` +} + +func init() { + t["VirtualMachinePrecisionClockInfo"] = reflect.TypeOf((*VirtualMachinePrecisionClockInfo)(nil)).Elem() +} + type VirtualMachineProfileDetails struct { DynamicData @@ -50846,32 +54443,47 @@ func init() { type VirtualMachineQuickStats struct { DynamicData - OverallCpuUsage int32 `xml:"overallCpuUsage,omitempty"` - OverallCpuDemand int32 `xml:"overallCpuDemand,omitempty"` - GuestMemoryUsage int32 `xml:"guestMemoryUsage,omitempty"` - HostMemoryUsage int32 `xml:"hostMemoryUsage,omitempty"` - GuestHeartbeatStatus ManagedEntityStatus `xml:"guestHeartbeatStatus"` - DistributedCpuEntitlement int32 `xml:"distributedCpuEntitlement,omitempty"` - DistributedMemoryEntitlement int32 `xml:"distributedMemoryEntitlement,omitempty"` - StaticCpuEntitlement int32 `xml:"staticCpuEntitlement,omitempty"` - StaticMemoryEntitlement int32 `xml:"staticMemoryEntitlement,omitempty"` - PrivateMemory int32 `xml:"privateMemory,omitempty"` - SharedMemory int32 `xml:"sharedMemory,omitempty"` - SwappedMemory int32 `xml:"swappedMemory,omitempty"` - BalloonedMemory int32 `xml:"balloonedMemory,omitempty"` - ConsumedOverheadMemory int32 `xml:"consumedOverheadMemory,omitempty"` - FtLogBandwidth int32 `xml:"ftLogBandwidth,omitempty"` - FtSecondaryLatency int32 `xml:"ftSecondaryLatency,omitempty"` - FtLatencyStatus ManagedEntityStatus `xml:"ftLatencyStatus,omitempty"` - CompressedMemory int64 `xml:"compressedMemory,omitempty"` - UptimeSeconds int32 `xml:"uptimeSeconds,omitempty"` - SsdSwappedMemory int64 `xml:"ssdSwappedMemory,omitempty"` + OverallCpuUsage int32 `xml:"overallCpuUsage,omitempty"` + OverallCpuDemand int32 `xml:"overallCpuDemand,omitempty"` + OverallCpuReadiness int32 `xml:"overallCpuReadiness,omitempty"` + GuestMemoryUsage int32 `xml:"guestMemoryUsage,omitempty"` + HostMemoryUsage int32 `xml:"hostMemoryUsage,omitempty"` + GuestHeartbeatStatus ManagedEntityStatus `xml:"guestHeartbeatStatus"` + DistributedCpuEntitlement int32 `xml:"distributedCpuEntitlement,omitempty"` + DistributedMemoryEntitlement int32 `xml:"distributedMemoryEntitlement,omitempty"` + StaticCpuEntitlement int32 `xml:"staticCpuEntitlement,omitempty"` + StaticMemoryEntitlement int32 `xml:"staticMemoryEntitlement,omitempty"` + GrantedMemory int32 `xml:"grantedMemory,omitempty"` + PrivateMemory int32 `xml:"privateMemory,omitempty"` + SharedMemory int32 `xml:"sharedMemory,omitempty"` + SwappedMemory int32 `xml:"swappedMemory,omitempty"` + BalloonedMemory int32 `xml:"balloonedMemory,omitempty"` + ConsumedOverheadMemory int32 `xml:"consumedOverheadMemory,omitempty"` + FtLogBandwidth int32 `xml:"ftLogBandwidth,omitempty"` + FtSecondaryLatency int32 `xml:"ftSecondaryLatency,omitempty"` + FtLatencyStatus ManagedEntityStatus `xml:"ftLatencyStatus,omitempty"` + CompressedMemory int64 `xml:"compressedMemory,omitempty"` + UptimeSeconds int32 `xml:"uptimeSeconds,omitempty"` + SsdSwappedMemory int64 `xml:"ssdSwappedMemory,omitempty"` + ActiveMemory int32 `xml:"activeMemory,omitempty"` + MemoryTierStats []VirtualMachineQuickStatsMemoryTierStats `xml:"memoryTierStats,omitempty"` } func init() { t["VirtualMachineQuickStats"] = reflect.TypeOf((*VirtualMachineQuickStats)(nil)).Elem() } +type VirtualMachineQuickStatsMemoryTierStats struct { + DynamicData + + MemoryTierType string `xml:"memoryTierType"` + ReadBandwidth int64 `xml:"readBandwidth"` +} + +func init() { + t["VirtualMachineQuickStatsMemoryTierStats"] = reflect.TypeOf((*VirtualMachineQuickStatsMemoryTierStats)(nil)).Elem() +} + type VirtualMachineRelocateSpec struct { DynamicData @@ -50885,6 +54497,7 @@ type VirtualMachineRelocateSpec struct { Transform VirtualMachineRelocateTransformation `xml:"transform,omitempty"` DeviceChange []BaseVirtualDeviceConfigSpec `xml:"deviceChange,omitempty,typeattr"` Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` + CryptoSpec BaseCryptoSpec `xml:"cryptoSpec,omitempty,typeattr"` } func init() { @@ -50894,17 +54507,30 @@ func init() { type VirtualMachineRelocateSpecDiskLocator struct { DynamicData - DiskId int32 `xml:"diskId"` - Datastore ManagedObjectReference `xml:"datastore"` - DiskMoveType string `xml:"diskMoveType,omitempty"` - DiskBackingInfo BaseVirtualDeviceBackingInfo `xml:"diskBackingInfo,omitempty,typeattr"` - Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` + DiskId int32 `xml:"diskId"` + Datastore ManagedObjectReference `xml:"datastore"` + DiskMoveType string `xml:"diskMoveType,omitempty"` + DiskBackingInfo BaseVirtualDeviceBackingInfo `xml:"diskBackingInfo,omitempty,typeattr"` + Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` + Backing *VirtualMachineRelocateSpecDiskLocatorBackingSpec `xml:"backing,omitempty"` + FilterSpec []BaseVirtualMachineBaseIndependentFilterSpec `xml:"filterSpec,omitempty,typeattr"` } func init() { t["VirtualMachineRelocateSpecDiskLocator"] = reflect.TypeOf((*VirtualMachineRelocateSpecDiskLocator)(nil)).Elem() } +type VirtualMachineRelocateSpecDiskLocatorBackingSpec struct { + DynamicData + + Parent *VirtualMachineRelocateSpecDiskLocatorBackingSpec `xml:"parent,omitempty"` + Crypto BaseCryptoSpec `xml:"crypto,omitempty,typeattr"` +} + +func init() { + t["VirtualMachineRelocateSpecDiskLocatorBackingSpec"] = reflect.TypeOf((*VirtualMachineRelocateSpecDiskLocatorBackingSpec)(nil)).Elem() +} + type VirtualMachineRuntimeInfo struct { DynamicData @@ -50912,6 +54538,7 @@ type VirtualMachineRuntimeInfo struct { Host *ManagedObjectReference `xml:"host,omitempty"` ConnectionState VirtualMachineConnectionState `xml:"connectionState"` PowerState VirtualMachinePowerState `xml:"powerState"` + VmFailoverInProgress *bool `xml:"vmFailoverInProgress"` FaultToleranceState VirtualMachineFaultToleranceState `xml:"faultToleranceState,omitempty"` DasVmProtection *VirtualMachineRuntimeInfoDasProtectionState `xml:"dasVmProtection,omitempty"` ToolsInstallerMounted bool `xml:"toolsInstallerMounted"` @@ -50938,6 +54565,8 @@ type VirtualMachineRuntimeInfo struct { QuiescedForkParent *bool `xml:"quiescedForkParent"` InstantCloneFrozen *bool `xml:"instantCloneFrozen"` CryptoState string `xml:"cryptoState,omitempty"` + SuspendedToMemory *bool `xml:"suspendedToMemory"` + OpNotificationTimeout int64 `xml:"opNotificationTimeout,omitempty"` } func init() { @@ -50986,6 +54615,32 @@ func init() { t["VirtualMachineSerialInfo"] = reflect.TypeOf((*VirtualMachineSerialInfo)(nil)).Elem() } +type VirtualMachineSgxInfo struct { + DynamicData + + EpcSize int64 `xml:"epcSize"` + FlcMode string `xml:"flcMode,omitempty"` + LePubKeyHash string `xml:"lePubKeyHash,omitempty"` + RequireAttestation *bool `xml:"requireAttestation"` +} + +func init() { + t["VirtualMachineSgxInfo"] = reflect.TypeOf((*VirtualMachineSgxInfo)(nil)).Elem() +} + +type VirtualMachineSgxTargetInfo struct { + VirtualMachineTargetInfo + + MaxEpcSize int64 `xml:"maxEpcSize"` + FlcModes []string `xml:"flcModes,omitempty"` + LePubKeyHashes []string `xml:"lePubKeyHashes,omitempty"` + RequireAttestationSupported *bool `xml:"requireAttestationSupported"` +} + +func init() { + t["VirtualMachineSgxTargetInfo"] = reflect.TypeOf((*VirtualMachineSgxTargetInfo)(nil)).Elem() +} + type VirtualMachineSnapshotInfo struct { DynamicData @@ -51113,11 +54768,13 @@ func init() { type VirtualMachineTicket struct { DynamicData - Ticket string `xml:"ticket"` - CfgFile string `xml:"cfgFile"` - Host string `xml:"host,omitempty"` - Port int32 `xml:"port,omitempty"` - SslThumbprint string `xml:"sslThumbprint,omitempty"` + Ticket string `xml:"ticket"` + CfgFile string `xml:"cfgFile"` + Host string `xml:"host,omitempty"` + Port int32 `xml:"port,omitempty"` + SslThumbprint string `xml:"sslThumbprint,omitempty"` + CertThumbprintList []VirtualMachineCertThumbprint `xml:"certThumbprintList,omitempty"` + Url string `xml:"url,omitempty"` } func init() { @@ -51235,6 +54892,72 @@ func init() { t["VirtualMachineVMIROM"] = reflect.TypeOf((*VirtualMachineVMIROM)(nil)).Elem() } +type VirtualMachineVcpuConfig struct { + DynamicData + + LatencySensitivity *LatencySensitivity `xml:"latencySensitivity,omitempty"` +} + +func init() { + t["VirtualMachineVcpuConfig"] = reflect.TypeOf((*VirtualMachineVcpuConfig)(nil)).Elem() +} + +type VirtualMachineVendorDeviceGroupInfo struct { + VirtualMachineTargetInfo + + DeviceGroupName string `xml:"deviceGroupName"` + DeviceGroupDescription string `xml:"deviceGroupDescription,omitempty"` + ComponentDeviceInfo []VirtualMachineVendorDeviceGroupInfoComponentDeviceInfo `xml:"componentDeviceInfo,omitempty"` +} + +func init() { + t["VirtualMachineVendorDeviceGroupInfo"] = reflect.TypeOf((*VirtualMachineVendorDeviceGroupInfo)(nil)).Elem() +} + +type VirtualMachineVendorDeviceGroupInfoComponentDeviceInfo struct { + DynamicData + + Type string `xml:"type"` + VendorName string `xml:"vendorName"` + DeviceName string `xml:"deviceName"` + IsConfigurable bool `xml:"isConfigurable"` + Device BaseVirtualDevice `xml:"device,typeattr"` +} + +func init() { + t["VirtualMachineVendorDeviceGroupInfoComponentDeviceInfo"] = reflect.TypeOf((*VirtualMachineVendorDeviceGroupInfoComponentDeviceInfo)(nil)).Elem() +} + +type VirtualMachineVgpuDeviceInfo struct { + VirtualMachineTargetInfo + + DeviceName string `xml:"deviceName"` + DeviceVendorId int64 `xml:"deviceVendorId"` + MaxFbSizeInGib int64 `xml:"maxFbSizeInGib"` + TimeSlicedCapable bool `xml:"timeSlicedCapable"` + MigCapable bool `xml:"migCapable"` + ComputeProfileCapable bool `xml:"computeProfileCapable"` + QuadroProfileCapable bool `xml:"quadroProfileCapable"` +} + +func init() { + t["VirtualMachineVgpuDeviceInfo"] = reflect.TypeOf((*VirtualMachineVgpuDeviceInfo)(nil)).Elem() +} + +type VirtualMachineVgpuProfileInfo struct { + VirtualMachineTargetInfo + + ProfileName string `xml:"profileName"` + DeviceVendorId int64 `xml:"deviceVendorId"` + FbSizeInGib int64 `xml:"fbSizeInGib"` + ProfileSharing string `xml:"profileSharing"` + ProfileClass string `xml:"profileClass"` +} + +func init() { + t["VirtualMachineVgpuProfileInfo"] = reflect.TypeOf((*VirtualMachineVgpuProfileInfo)(nil)).Elem() +} + type VirtualMachineVideoCard struct { VirtualDevice @@ -51250,6 +54973,92 @@ func init() { t["VirtualMachineVideoCard"] = reflect.TypeOf((*VirtualMachineVideoCard)(nil)).Elem() } +type VirtualMachineVirtualDeviceGroups struct { + DynamicData + + DeviceGroup []BaseVirtualMachineVirtualDeviceGroupsDeviceGroup `xml:"deviceGroup,omitempty,typeattr"` +} + +func init() { + t["VirtualMachineVirtualDeviceGroups"] = reflect.TypeOf((*VirtualMachineVirtualDeviceGroups)(nil)).Elem() +} + +type VirtualMachineVirtualDeviceGroupsDeviceGroup struct { + DynamicData + + GroupInstanceKey int32 `xml:"groupInstanceKey"` + DeviceInfo BaseDescription `xml:"deviceInfo,omitempty,typeattr"` +} + +func init() { + t["VirtualMachineVirtualDeviceGroupsDeviceGroup"] = reflect.TypeOf((*VirtualMachineVirtualDeviceGroupsDeviceGroup)(nil)).Elem() +} + +type VirtualMachineVirtualDeviceGroupsVendorDeviceGroup struct { + VirtualMachineVirtualDeviceGroupsDeviceGroup + + DeviceGroupName string `xml:"deviceGroupName"` +} + +func init() { + t["VirtualMachineVirtualDeviceGroupsVendorDeviceGroup"] = reflect.TypeOf((*VirtualMachineVirtualDeviceGroupsVendorDeviceGroup)(nil)).Elem() +} + +type VirtualMachineVirtualDeviceSwap struct { + DynamicData + + LsiToPvscsi *VirtualMachineVirtualDeviceSwapDeviceSwapInfo `xml:"lsiToPvscsi,omitempty"` +} + +func init() { + t["VirtualMachineVirtualDeviceSwap"] = reflect.TypeOf((*VirtualMachineVirtualDeviceSwap)(nil)).Elem() +} + +type VirtualMachineVirtualDeviceSwapDeviceSwapInfo struct { + DynamicData + + Enabled *bool `xml:"enabled"` + Applicable *bool `xml:"applicable"` + Status string `xml:"status,omitempty"` +} + +func init() { + t["VirtualMachineVirtualDeviceSwapDeviceSwapInfo"] = reflect.TypeOf((*VirtualMachineVirtualDeviceSwapDeviceSwapInfo)(nil)).Elem() +} + +type VirtualMachineVirtualNuma struct { + DynamicData + + CoresPerNumaNode int32 `xml:"coresPerNumaNode,omitempty"` + ExposeVnumaOnCpuHotadd *bool `xml:"exposeVnumaOnCpuHotadd"` +} + +func init() { + t["VirtualMachineVirtualNuma"] = reflect.TypeOf((*VirtualMachineVirtualNuma)(nil)).Elem() +} + +type VirtualMachineVirtualNumaInfo struct { + DynamicData + + CoresPerNumaNode int32 `xml:"coresPerNumaNode,omitempty"` + AutoCoresPerNumaNode *bool `xml:"autoCoresPerNumaNode"` + VnumaOnCpuHotaddExposed *bool `xml:"vnumaOnCpuHotaddExposed"` +} + +func init() { + t["VirtualMachineVirtualNumaInfo"] = reflect.TypeOf((*VirtualMachineVirtualNumaInfo)(nil)).Elem() +} + +type VirtualMachineVirtualPMem struct { + DynamicData + + SnapshotMode string `xml:"snapshotMode,omitempty"` +} + +func init() { + t["VirtualMachineVirtualPMem"] = reflect.TypeOf((*VirtualMachineVirtualPMem)(nil)).Elem() +} + type VirtualMachineWindowsQuiesceSpec struct { VirtualMachineGuestQuiesceSpec @@ -51277,7 +55086,8 @@ func init() { type VirtualNVDIMM struct { VirtualDevice - CapacityInMB int64 `xml:"capacityInMB"` + CapacityInMB int64 `xml:"capacityInMB"` + ConfiguredCapacityInMB int64 `xml:"configuredCapacityInMB,omitempty"` } func init() { @@ -51395,6 +55205,20 @@ func init() { t["VirtualPCIPassthrough"] = reflect.TypeOf((*VirtualPCIPassthrough)(nil)).Elem() } +type VirtualPCIPassthroughAllowedDevice struct { + DynamicData + + VendorId int32 `xml:"vendorId"` + DeviceId int32 `xml:"deviceId"` + SubVendorId int32 `xml:"subVendorId,omitempty"` + SubDeviceId int32 `xml:"subDeviceId,omitempty"` + RevisionId int16 `xml:"revisionId,omitempty"` +} + +func init() { + t["VirtualPCIPassthroughAllowedDevice"] = reflect.TypeOf((*VirtualPCIPassthroughAllowedDevice)(nil)).Elem() +} + type VirtualPCIPassthroughDeviceBackingInfo struct { VirtualDeviceDeviceBackingInfo @@ -51416,6 +55240,45 @@ func init() { t["VirtualPCIPassthroughDeviceBackingOption"] = reflect.TypeOf((*VirtualPCIPassthroughDeviceBackingOption)(nil)).Elem() } +type VirtualPCIPassthroughDvxBackingInfo struct { + VirtualDeviceBackingInfo + + DeviceClass string `xml:"deviceClass,omitempty"` + ConfigParams []BaseOptionValue `xml:"configParams,omitempty,typeattr"` +} + +func init() { + t["VirtualPCIPassthroughDvxBackingInfo"] = reflect.TypeOf((*VirtualPCIPassthroughDvxBackingInfo)(nil)).Elem() +} + +type VirtualPCIPassthroughDvxBackingOption struct { + VirtualDeviceBackingOption +} + +func init() { + t["VirtualPCIPassthroughDvxBackingOption"] = reflect.TypeOf((*VirtualPCIPassthroughDvxBackingOption)(nil)).Elem() +} + +type VirtualPCIPassthroughDynamicBackingInfo struct { + VirtualDeviceDeviceBackingInfo + + AllowedDevice []VirtualPCIPassthroughAllowedDevice `xml:"allowedDevice,omitempty"` + CustomLabel string `xml:"customLabel,omitempty"` + AssignedId string `xml:"assignedId,omitempty"` +} + +func init() { + t["VirtualPCIPassthroughDynamicBackingInfo"] = reflect.TypeOf((*VirtualPCIPassthroughDynamicBackingInfo)(nil)).Elem() +} + +type VirtualPCIPassthroughDynamicBackingOption struct { + VirtualDeviceDeviceBackingOption +} + +func init() { + t["VirtualPCIPassthroughDynamicBackingOption"] = reflect.TypeOf((*VirtualPCIPassthroughDynamicBackingOption)(nil)).Elem() +} + type VirtualPCIPassthroughOption struct { VirtualDeviceOption } @@ -51443,7 +55306,10 @@ func init() { type VirtualPCIPassthroughVmiopBackingInfo struct { VirtualPCIPassthroughPluginBackingInfo - Vgpu string `xml:"vgpu,omitempty"` + Vgpu string `xml:"vgpu,omitempty"` + VgpuMigrateDataSizeMB int32 `xml:"vgpuMigrateDataSizeMB,omitempty"` + MigrateSupported *bool `xml:"migrateSupported"` + EnhancedMigrateCapability *bool `xml:"enhancedMigrateCapability"` } func init() { @@ -51582,6 +55448,42 @@ func init() { t["VirtualPointingDeviceOption"] = reflect.TypeOf((*VirtualPointingDeviceOption)(nil)).Elem() } +type VirtualPrecisionClock struct { + VirtualDevice +} + +func init() { + t["VirtualPrecisionClock"] = reflect.TypeOf((*VirtualPrecisionClock)(nil)).Elem() +} + +type VirtualPrecisionClockOption struct { + VirtualDeviceOption +} + +func init() { + t["VirtualPrecisionClockOption"] = reflect.TypeOf((*VirtualPrecisionClockOption)(nil)).Elem() +} + +type VirtualPrecisionClockSystemClockBackingInfo struct { + VirtualDeviceBackingInfo + + Protocol string `xml:"protocol,omitempty"` +} + +func init() { + t["VirtualPrecisionClockSystemClockBackingInfo"] = reflect.TypeOf((*VirtualPrecisionClockSystemClockBackingInfo)(nil)).Elem() +} + +type VirtualPrecisionClockSystemClockBackingOption struct { + VirtualDeviceBackingOption + + Protocol ChoiceOption `xml:"protocol"` +} + +func init() { + t["VirtualPrecisionClockSystemClockBackingOption"] = reflect.TypeOf((*VirtualPrecisionClockSystemClockBackingOption)(nil)).Elem() +} + type VirtualSATAController struct { VirtualController } @@ -51840,6 +55742,7 @@ type VirtualSriovEthernetCard struct { AllowGuestOSMtuChange *bool `xml:"allowGuestOSMtuChange"` SriovBacking *VirtualSriovEthernetCardSriovBackingInfo `xml:"sriovBacking,omitempty"` + DvxBackingInfo *VirtualPCIPassthroughDvxBackingInfo `xml:"dvxBackingInfo,omitempty"` } func init() { @@ -52095,6 +55998,8 @@ func init() { type VirtualVmxnet3 struct { VirtualVmxnet + + Uptv2Enabled *bool `xml:"uptv2Enabled"` } func init() { @@ -52103,6 +56008,8 @@ func init() { type VirtualVmxnet3Option struct { VirtualVmxnetOption + + Uptv2Enabled *BoolOption `xml:"uptv2Enabled,omitempty"` } func init() { @@ -52137,6 +56044,27 @@ func init() { t["VirtualVmxnetOption"] = reflect.TypeOf((*VirtualVmxnetOption)(nil)).Elem() } +type VirtualWDT struct { + VirtualDevice + + RunOnBoot bool `xml:"runOnBoot"` + Running bool `xml:"running"` +} + +func init() { + t["VirtualWDT"] = reflect.TypeOf((*VirtualWDT)(nil)).Elem() +} + +type VirtualWDTOption struct { + VirtualDeviceOption + + RunOnBoot BoolOption `xml:"runOnBoot"` +} + +func init() { + t["VirtualWDTOption"] = reflect.TypeOf((*VirtualWDTOption)(nil)).Elem() +} + type VlanProfile struct { ApplyProfile } @@ -53874,6 +57802,7 @@ type VmfsConfigOption struct { UnmapBandwidthDynamicMin *LongOption `xml:"unmapBandwidthDynamicMin,omitempty"` UnmapBandwidthDynamicMax *LongOption `xml:"unmapBandwidthDynamicMax,omitempty"` UnmapBandwidthIncrement int64 `xml:"unmapBandwidthIncrement,omitempty"` + UnmapBandwidthUltraLow int64 `xml:"unmapBandwidthUltraLow,omitempty"` } func init() { @@ -54126,8 +58055,9 @@ func init() { type VsanClusterConfigInfo struct { DynamicData - Enabled *bool `xml:"enabled"` - DefaultConfig *VsanClusterConfigInfoHostDefaultInfo `xml:"defaultConfig,omitempty"` + Enabled *bool `xml:"enabled"` + DefaultConfig *VsanClusterConfigInfoHostDefaultInfo `xml:"defaultConfig,omitempty"` + VsanEsaEnabled *bool `xml:"vsanEsaEnabled"` } func init() { @@ -54163,6 +58093,17 @@ func init() { t["VsanClusterUuidMismatchFault"] = reflect.TypeOf((*VsanClusterUuidMismatchFault)(nil)).Elem() } +type VsanDatastoreInfo struct { + DatastoreInfo + + MembershipUuid string `xml:"membershipUuid,omitempty"` + AccessGenNo int32 `xml:"accessGenNo,omitempty"` +} + +func init() { + t["VsanDatastoreInfo"] = reflect.TypeOf((*VsanDatastoreInfo)(nil)).Elem() +} + type VsanDiskFault struct { VsanFault @@ -54238,6 +58179,7 @@ type VsanHostConfigInfo struct { StorageInfo *VsanHostConfigInfoStorageInfo `xml:"storageInfo,omitempty"` NetworkInfo *VsanHostConfigInfoNetworkInfo `xml:"networkInfo,omitempty"` FaultDomainInfo *VsanHostFaultDomainInfo `xml:"faultDomainInfo,omitempty"` + VsanEsaEnabled *bool `xml:"vsanEsaEnabled"` } func init() { @@ -54651,8 +58593,9 @@ func init() { type VslmCloneSpec struct { VslmMigrateSpec - Name string `xml:"name"` - KeepAfterDeleteVm *bool `xml:"keepAfterDeleteVm"` + Name string `xml:"name"` + KeepAfterDeleteVm *bool `xml:"keepAfterDeleteVm"` + Metadata []KeyValue `xml:"metadata,omitempty"` } func init() { @@ -54667,6 +58610,8 @@ type VslmCreateSpec struct { BackingSpec BaseVslmCreateSpecBackingSpec `xml:"backingSpec,typeattr"` CapacityInMB int64 `xml:"capacityInMB"` Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` + Crypto BaseCryptoSpec `xml:"crypto,omitempty,typeattr"` + Metadata []KeyValue `xml:"metadata,omitempty"` } func init() { @@ -54711,6 +58656,7 @@ type VslmMigrateSpec struct { BackingSpec BaseVslmCreateSpecBackingSpec `xml:"backingSpec,typeattr"` Profile []BaseVirtualMachineProfileSpec `xml:"profile,omitempty,typeattr"` Consolidate *bool `xml:"consolidate"` + DisksCrypto *DiskCryptoSpec `xml:"disksCrypto,omitempty"` } func init() { @@ -54872,6 +58818,29 @@ func init() { t["VspanSameSessionPortConflictFault"] = reflect.TypeOf((*VspanSameSessionPortConflictFault)(nil)).Elem() } +type VstorageObjectVCenterQueryChangedDiskAreas VstorageObjectVCenterQueryChangedDiskAreasRequestType + +func init() { + t["VstorageObjectVCenterQueryChangedDiskAreas"] = reflect.TypeOf((*VstorageObjectVCenterQueryChangedDiskAreas)(nil)).Elem() +} + +type VstorageObjectVCenterQueryChangedDiskAreasRequestType struct { + This ManagedObjectReference `xml:"_this"` + Id ID `xml:"id"` + Datastore ManagedObjectReference `xml:"datastore"` + SnapshotId ID `xml:"snapshotId"` + StartOffset int64 `xml:"startOffset"` + ChangeId string `xml:"changeId"` +} + +func init() { + t["VstorageObjectVCenterQueryChangedDiskAreasRequestType"] = reflect.TypeOf((*VstorageObjectVCenterQueryChangedDiskAreasRequestType)(nil)).Elem() +} + +type VstorageObjectVCenterQueryChangedDiskAreasResponse struct { + Returnval DiskChangeInfo `xml:"returnval"` +} + type VvolDatastoreInfo struct { DatastoreInfo @@ -55431,3 +59400,13 @@ type VslmInfrastructureObjectPolicySpec struct { func init() { t["vslmInfrastructureObjectPolicySpec"] = reflect.TypeOf((*VslmInfrastructureObjectPolicySpec)(nil)).Elem() } + +type VslmVClockInfo struct { + DynamicData + + VClockTime int64 `xml:"vClockTime"` +} + +func init() { + t["vslmVClockInfo"] = reflect.TypeOf((*VslmVClockInfo)(nil)).Elem() +} diff --git a/vendor/github.com/vmware/govmomi/vim25/types/unreleased.go b/vendor/github.com/vmware/govmomi/vim25/types/unreleased.go new file mode 100644 index 00000000000..72bc1082b87 --- /dev/null +++ b/vendor/github.com/vmware/govmomi/vim25/types/unreleased.go @@ -0,0 +1,121 @@ +/* + Copyright (c) 2022 VMware, Inc. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +package types + +import "reflect" + +type ArrayOfPlaceVmsXClusterResultPlacementFaults struct { + PlaceVmsXClusterResultPlacementFaults []PlaceVmsXClusterResultPlacementFaults `xml:"PlaceVmsXClusterResultPlacementFaults,omitempty"` +} + +func init() { + t["ArrayOfPlaceVmsXClusterResultPlacementFaults"] = reflect.TypeOf((*ArrayOfPlaceVmsXClusterResultPlacementFaults)(nil)).Elem() +} + +type ArrayOfPlaceVmsXClusterResultPlacementInfo struct { + PlaceVmsXClusterResultPlacementInfo []PlaceVmsXClusterResultPlacementInfo `xml:"PlaceVmsXClusterResultPlacementInfo,omitempty"` +} + +func init() { + t["ArrayOfPlaceVmsXClusterResultPlacementInfo"] = reflect.TypeOf((*ArrayOfPlaceVmsXClusterResultPlacementInfo)(nil)).Elem() +} + +type ArrayOfPlaceVmsXClusterSpecVmPlacementSpec struct { + PlaceVmsXClusterSpecVmPlacementSpec []PlaceVmsXClusterSpecVmPlacementSpec `xml:"PlaceVmsXClusterSpecVmPlacementSpec,omitempty"` +} + +func init() { + t["ArrayOfPlaceVmsXClusterSpecVmPlacementSpec"] = reflect.TypeOf((*ArrayOfPlaceVmsXClusterSpecVmPlacementSpec)(nil)).Elem() +} + +type PlaceVmsXCluster PlaceVmsXClusterRequestType + +func init() { + t["PlaceVmsXCluster"] = reflect.TypeOf((*PlaceVmsXCluster)(nil)).Elem() +} + +type PlaceVmsXClusterRequestType struct { + This ManagedObjectReference `xml:"_this"` + PlacementSpec PlaceVmsXClusterSpec `xml:"placementSpec"` +} + +func init() { + t["PlaceVmsXClusterRequestType"] = reflect.TypeOf((*PlaceVmsXClusterRequestType)(nil)).Elem() +} + +type PlaceVmsXClusterResponse struct { + Returnval PlaceVmsXClusterResult `xml:"returnval"` +} + +type PlaceVmsXClusterResult struct { + DynamicData + + PlacementInfos []PlaceVmsXClusterResultPlacementInfo `xml:"placementInfos,omitempty"` + Faults []PlaceVmsXClusterResultPlacementFaults `xml:"faults,omitempty"` +} + +func init() { + t["PlaceVmsXClusterResult"] = reflect.TypeOf((*PlaceVmsXClusterResult)(nil)).Elem() +} + +type PlaceVmsXClusterResultPlacementFaults struct { + DynamicData + + ResourcePool ManagedObjectReference `xml:"resourcePool"` + VmName string `xml:"vmName"` + Faults []LocalizedMethodFault `xml:"faults,omitempty"` +} + +func init() { + t["PlaceVmsXClusterResultPlacementFaults"] = reflect.TypeOf((*PlaceVmsXClusterResultPlacementFaults)(nil)).Elem() +} + +type PlaceVmsXClusterResultPlacementInfo struct { + DynamicData + + VmName string `xml:"vmName"` + Recommendation ClusterRecommendation `xml:"recommendation"` +} + +func init() { + t["PlaceVmsXClusterResultPlacementInfo"] = reflect.TypeOf((*PlaceVmsXClusterResultPlacementInfo)(nil)).Elem() +} + +type PlaceVmsXClusterSpec struct { + DynamicData + + ResourcePools []ManagedObjectReference `xml:"resourcePools,omitempty"` + VmPlacementSpecs []PlaceVmsXClusterSpecVmPlacementSpec `xml:"vmPlacementSpecs,omitempty"` + HostRecommRequired *bool `xml:"hostRecommRequired"` + DatastoreRecommRequired *bool `xml:"datastoreRecommRequired"` +} + +func init() { + t["PlaceVmsXClusterSpec"] = reflect.TypeOf((*PlaceVmsXClusterSpec)(nil)).Elem() +} + +type PlaceVmsXClusterSpecVmPlacementSpec struct { + DynamicData + + ConfigSpec VirtualMachineConfigSpec `xml:"configSpec"` +} + +func init() { + t["PlaceVmsXClusterSpecVmPlacementSpec"] = reflect.TypeOf((*PlaceVmsXClusterSpecVmPlacementSpec)(nil)).Elem() +} + +const RecommendationReasonCodeXClusterPlacement = RecommendationReasonCode("xClusterPlacement") diff --git a/vendor/github.com/vmware/govmomi/vim25/xml/LICENSE b/vendor/github.com/vmware/govmomi/vim25/xml/LICENSE index 74487567632..6a66aea5eaf 100644 --- a/vendor/github.com/vmware/govmomi/vim25/xml/LICENSE +++ b/vendor/github.com/vmware/govmomi/vim25/xml/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2012 The Go Authors. All rights reserved. +Copyright (c) 2009 The Go Authors. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are diff --git a/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go b/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go index 39bbac1d171..c0c0a588bf5 100644 --- a/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go +++ b/vendor/github.com/vmware/govmomi/vim25/xml/marshal.go @@ -16,7 +16,7 @@ import ( ) const ( - // A generic XML header suitable for use with the output of Marshal. + // Header is a generic XML header suitable for use with the output of Marshal. // This is not automatically added to any output of this package, // it is provided as a convenience. Header = `` + "\n" @@ -24,21 +24,21 @@ const ( // Marshal returns the XML encoding of v. // -// Marshal handles an array or slice by marshalling each of the elements. -// Marshal handles a pointer by marshalling the value it points at or, if the -// pointer is nil, by writing nothing. Marshal handles an interface value by -// marshalling the value it contains or, if the interface value is nil, by -// writing nothing. Marshal handles all other data by writing one or more XML +// Marshal handles an array or slice by marshaling each of the elements. +// Marshal handles a pointer by marshaling the value it points at or, if the +// pointer is nil, by writing nothing. Marshal handles an interface value by +// marshaling the value it contains or, if the interface value is nil, by +// writing nothing. Marshal handles all other data by writing one or more XML // elements containing the data. // // The name for the XML elements is taken from, in order of preference: // - the tag on the XMLName field, if the data is a struct -// - the value of the XMLName field of type xml.Name +// - the value of the XMLName field of type Name // - the tag of the struct field used to obtain the data // - the name of the struct field used to obtain the data -// - the name of the marshalled type +// - the name of the marshaled type // -// The XML element for a struct contains marshalled elements for each of the +// The XML element for a struct contains marshaled elements for each of the // exported fields of the struct, with these exceptions: // - the XMLName field, described above, is omitted. // - a field with tag "-" is omitted. @@ -48,10 +48,12 @@ const ( // field name in the XML element. // - a field with tag ",chardata" is written as character data, // not as an XML element. +// - a field with tag ",cdata" is written as character data +// wrapped in one or more tags, not as an XML element. // - a field with tag ",innerxml" is written verbatim, not subject -// to the usual marshalling procedure. +// to the usual marshaling procedure. // - a field with tag ",comment" is written as an XML comment, not -// subject to the usual marshalling procedure. It must not contain +// subject to the usual marshaling procedure. It must not contain // the "--" string within it. // - a field with a tag including the "omitempty" option is omitted // if the field value is empty. The empty values are false, 0, any @@ -59,11 +61,18 @@ const ( // string of length zero. // - an anonymous struct field is handled as if the fields of its // value were part of the outer struct. +// - a field implementing Marshaler is written by calling its MarshalXML +// method. +// - a field implementing encoding.TextMarshaler is written by encoding the +// result of its MarshalText method as text. // // If a field uses a tag "a>b>c", then the element c will be nested inside -// parent elements a and b. Fields that appear next to each other that name +// parent elements a and b. Fields that appear next to each other that name // the same parent will be enclosed in one XML element. // +// If the XML name for a struct field is defined by both the field tag and the +// struct's XMLName field, the names must match. +// // See MarshalIndent for an example. // // Marshal will return an error if asked to marshal a channel, function, or map. @@ -173,9 +182,9 @@ func (enc *Encoder) EncodeElement(v interface{}, start StartElement) error { } var ( - endComment = []byte("-->") - endProcInst = []byte("?>") - endDirective = []byte(">") + begComment = []byte("") + endProcInst = []byte("?>") ) // EncodeToken writes the given XML token to the stream. @@ -191,6 +200,7 @@ var ( // EncodeToken allows writing a ProcInst with Target set to "xml" only as the first token // in the stream. func (enc *Encoder) EncodeToken(t Token) error { + p := &enc.p switch t := t.(type) { case StartElement: @@ -202,7 +212,7 @@ func (enc *Encoder) EncodeToken(t Token) error { return err } case CharData: - EscapeText(p, t) + escapeText(p, t, false) case Comment: if bytes.Contains(t, endComment) { return fmt.Errorf("xml: EncodeToken of Comment containing --> marker") @@ -213,7 +223,7 @@ func (enc *Encoder) EncodeToken(t Token) error { return p.cachedWriteError() case ProcInst: // First token to be encoded which is also a ProcInst with target of xml - // is the xml declaration. The only ProcInst where target of xml is allowed. + // is the xml declaration. The only ProcInst where target of xml is allowed. if t.Target == "xml" && p.Buffered() != 0 { return fmt.Errorf("xml: EncodeToken of ProcInst xml target only valid for xml declaration, first token encoded") } @@ -231,16 +241,59 @@ func (enc *Encoder) EncodeToken(t Token) error { } p.WriteString("?>") case Directive: - if bytes.Contains(t, endDirective) { - return fmt.Errorf("xml: EncodeToken of Directive containing > marker") + if !isValidDirective(t) { + return fmt.Errorf("xml: EncodeToken of Directive containing wrong < or > markers") } p.WriteString("") + default: + return fmt.Errorf("xml: EncodeToken of invalid token type") + } return p.cachedWriteError() } +// isValidDirective reports whether dir is a valid directive text, +// meaning angle brackets are matched, ignoring comments and strings. +func isValidDirective(dir Directive) bool { + var ( + depth int + inquote uint8 + incomment bool + ) + for i, c := range dir { + switch { + case incomment: + if c == '>' { + if n := 1 + i - len(endComment); n >= 0 && bytes.Equal(dir[n:i+1], endComment) { + incomment = false + } + } + // Just ignore anything in comment + case inquote != 0: + if c == inquote { + inquote = 0 + } + // Just ignore anything within quotes + case c == '\'' || c == '"': + inquote = c + case c == '<': + if i+len(begComment) < len(dir) && bytes.Equal(dir[i:i+len(begComment)], begComment) { + incomment = true + } else { + depth++ + } + case c == '>': + if depth == 0 { + return false + } + depth-- + } + } + return depth == 0 && inquote == 0 && !incomment +} + // Flush flushes any buffered XML to the underlying writer. // See the EncodeToken documentation for details about when it is necessary. func (enc *Encoder) Flush() error { @@ -274,7 +327,7 @@ func (p *printer) createAttrPrefix(url string) string { // (The "http://www.w3.org/2000/xmlns/" name space is also predefined as "xmlns", // but users should not be trying to use that one directly - that's our job.) if url == xmlURL { - return "xml" + return xmlPrefix } // Need to define a new name space. @@ -426,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 { @@ -452,8 +508,7 @@ func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo, startTemplat if finfo.flags&fAttr == 0 { continue } - fv := finfo.value(val) - name := Name{Space: finfo.xmlns, Local: finfo.name} + fv := finfo.value(val, dontInitNilPointers) if finfo.flags&fOmitEmpty != 0 && isEmptyValue(fv) { continue @@ -463,69 +518,10 @@ func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo, startTemplat continue } - if fv.CanInterface() && fv.Type().Implements(marshalerAttrType) { - attr, err := fv.Interface().(MarshalerAttr).MarshalXMLAttr(name) - if err != nil { - return err - } - if attr.Name.Local != "" { - start.Attr = append(start.Attr, attr) - } - continue - } - - if fv.CanAddr() { - pv := fv.Addr() - if pv.CanInterface() && pv.Type().Implements(marshalerAttrType) { - attr, err := pv.Interface().(MarshalerAttr).MarshalXMLAttr(name) - if err != nil { - return err - } - if attr.Name.Local != "" { - start.Attr = append(start.Attr, attr) - } - continue - } - } - - if fv.CanInterface() && fv.Type().Implements(textMarshalerType) { - text, err := fv.Interface().(encoding.TextMarshaler).MarshalText() - if err != nil { - return err - } - start.Attr = append(start.Attr, Attr{name, string(text)}) - continue - } - - if fv.CanAddr() { - pv := fv.Addr() - if pv.CanInterface() && pv.Type().Implements(textMarshalerType) { - text, err := pv.Interface().(encoding.TextMarshaler).MarshalText() - if err != nil { - return err - } - start.Attr = append(start.Attr, Attr{name, string(text)}) - continue - } - } - - // Dereference or skip nil pointer, interface values. - switch fv.Kind() { - case reflect.Ptr, reflect.Interface: - if fv.IsNil() { - continue - } - fv = fv.Elem() - } - - s, b, err := p.marshalSimple(fv.Type(), fv) - if err != nil { + name := Name{Space: finfo.xmlns, Local: finfo.name} + if err := p.marshalAttr(&start, name, fv); err != nil { return err } - if b != nil { - s = string(b) - } - start.Attr = append(start.Attr, Attr{name, s}) } if err := p.writeStart(&start); err != nil { @@ -555,6 +551,90 @@ func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo, startTemplat return p.cachedWriteError() } +// marshalAttr marshals an attribute with the given name and value, adding to start.Attr. +func (p *printer) marshalAttr(start *StartElement, name Name, val reflect.Value) error { + if val.CanInterface() && val.Type().Implements(marshalerAttrType) { + attr, err := val.Interface().(MarshalerAttr).MarshalXMLAttr(name) + if err != nil { + return err + } + if attr.Name.Local != "" { + start.Attr = append(start.Attr, attr) + } + return nil + } + + if val.CanAddr() { + pv := val.Addr() + if pv.CanInterface() && pv.Type().Implements(marshalerAttrType) { + attr, err := pv.Interface().(MarshalerAttr).MarshalXMLAttr(name) + if err != nil { + return err + } + if attr.Name.Local != "" { + start.Attr = append(start.Attr, attr) + } + return nil + } + } + + if val.CanInterface() && val.Type().Implements(textMarshalerType) { + text, err := val.Interface().(encoding.TextMarshaler).MarshalText() + if err != nil { + return err + } + start.Attr = append(start.Attr, Attr{name, string(text)}) + return nil + } + + if val.CanAddr() { + pv := val.Addr() + if pv.CanInterface() && pv.Type().Implements(textMarshalerType) { + text, err := pv.Interface().(encoding.TextMarshaler).MarshalText() + if err != nil { + return err + } + start.Attr = append(start.Attr, Attr{name, string(text)}) + return nil + } + } + + // Dereference or skip nil pointer, interface values. + switch val.Kind() { + case reflect.Ptr, reflect.Interface: + if val.IsNil() { + return nil + } + val = val.Elem() + } + + // Walk slices. + if val.Kind() == reflect.Slice && val.Type().Elem().Kind() != reflect.Uint8 { + n := val.Len() + for i := 0; i < n; i++ { + if err := p.marshalAttr(start, name, val.Index(i)); err != nil { + return err + } + } + return nil + } + + if val.Type() == attrType { + start.Attr = append(start.Attr, val.Interface().(Attr)) + return nil + } + + s, b, err := p.marshalSimple(val.Type(), val) + if err != nil { + return err + } + if b != nil { + s = string(b) + } + start.Attr = append(start.Attr, Attr{name, s}) + return nil +} + // defaultStart returns the default start element to use, // given the reflect type, field info, and start template. func defaultStart(typ reflect.Type, finfo *fieldInfo, startTemplate *StartElement) StartElement { @@ -716,6 +796,20 @@ func (p *printer) marshalSimple(typ reflect.Type, val reflect.Value) (string, [] var ddBytes = []byte("--") +// indirect drills into interfaces and pointers, returning the pointed-at value. +// If it encounters a nil interface or pointer, indirect returns that nil value. +// This can turn into an infinite loop given a cyclic chain, +// but it matches the Go 1 behavior. +func indirect(vf reflect.Value) reflect.Value { + for vf.Kind() == reflect.Interface || vf.Kind() == reflect.Ptr { + if vf.IsNil() { + return vf + } + vf = vf.Elem() + } + return vf +} + func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error { s := parentStack{p: p} for i := range tinfo.fields { @@ -723,24 +817,30 @@ func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error { if finfo.flags&fAttr != 0 { continue } - vf := finfo.value(val) - - // Dereference or skip nil pointer, interface values. - switch vf.Kind() { - case reflect.Ptr, reflect.Interface: - if !vf.IsNil() { - vf = vf.Elem() - } + 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 fCharData: + case fCDATA, fCharData: + emit := EscapeText + if finfo.flags&fMode == fCDATA { + emit = emitCDATA + } + if err := s.trim(finfo.parents); err != nil { + return err + } if vf.CanInterface() && vf.Type().Implements(textMarshalerType) { data, err := vf.Interface().(encoding.TextMarshaler).MarshalText() if err != nil { return err } - Escape(p, data) + if err := emit(p, data); err != nil { + return err + } continue } if vf.CanAddr() { @@ -750,27 +850,39 @@ func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error { if err != nil { return err } - Escape(p, data) + if err := emit(p, data); err != nil { + return err + } continue } } + var scratch [64]byte + vf = indirect(vf) switch vf.Kind() { case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - Escape(p, strconv.AppendInt(scratch[:0], vf.Int(), 10)) + if err := emit(p, strconv.AppendInt(scratch[:0], vf.Int(), 10)); err != nil { + return err + } case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: - Escape(p, strconv.AppendUint(scratch[:0], vf.Uint(), 10)) + if err := emit(p, strconv.AppendUint(scratch[:0], vf.Uint(), 10)); err != nil { + return err + } case reflect.Float32, reflect.Float64: - Escape(p, strconv.AppendFloat(scratch[:0], vf.Float(), 'g', -1, vf.Type().Bits())) + if err := emit(p, strconv.AppendFloat(scratch[:0], vf.Float(), 'g', -1, vf.Type().Bits())); err != nil { + return err + } case reflect.Bool: - Escape(p, strconv.AppendBool(scratch[:0], vf.Bool())) + if err := emit(p, strconv.AppendBool(scratch[:0], vf.Bool())); err != nil { + return err + } case reflect.String: - if err := EscapeText(p, []byte(vf.String())); err != nil { + if err := emit(p, []byte(vf.String())); err != nil { return err } case reflect.Slice: if elem, ok := vf.Interface().([]byte); ok { - if err := EscapeText(p, elem); err != nil { + if err := emit(p, elem); err != nil { return err } } @@ -778,6 +890,10 @@ func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error { continue case fComment: + if err := s.trim(finfo.parents); err != nil { + return err + } + vf = indirect(vf) k := vf.Kind() if !(k == reflect.String || k == reflect.Slice && vf.Type().Elem().Kind() == reflect.Uint8) { return fmt.Errorf("xml: bad type for comment field of %s", val.Type()) @@ -792,14 +908,14 @@ func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error { switch k { case reflect.String: s := vf.String() - dashDash = strings.Index(s, "--") >= 0 + dashDash = strings.Contains(s, "--") dashLast = s[len(s)-1] == '-' if !dashDash { p.WriteString(s) } case reflect.Slice: b := vf.Bytes() - dashDash = bytes.Index(b, ddBytes) >= 0 + dashDash = bytes.Contains(b, ddBytes) dashLast = b[len(b)-1] == '-' if !dashDash { p.Write(b) @@ -817,7 +933,8 @@ 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) { case []byte: @@ -891,8 +1008,8 @@ type parentStack struct { } // trim updates the XML context to match the longest common prefix of the stack -// and the given parents. A closing tag will be written for every parent -// popped. Passing a zero slice or nil will close all the elements. +// and the given parents. A closing tag will be written for every parent +// popped. Passing a zero slice or nil will close all the elements. func (s *parentStack) trim(parents []string) error { split := 0 for ; split < len(parents) && split < len(s.stack); split++ { @@ -905,7 +1022,7 @@ func (s *parentStack) trim(parents []string) error { return err } } - s.stack = parents[:split] + s.stack = s.stack[:split] return nil } @@ -920,7 +1037,7 @@ func (s *parentStack) push(parents []string) error { return nil } -// A MarshalXMLError is returned when Marshal encounters a type +// UnsupportedTypeError is returned when Marshal encounters a type // that cannot be converted into XML. type UnsupportedTypeError struct { Type reflect.Type diff --git a/vendor/github.com/vmware/govmomi/vim25/xml/read.go b/vendor/github.com/vmware/govmomi/vim25/xml/read.go index fe35fce6ca4..ea61352f6db 100644 --- a/vendor/github.com/vmware/govmomi/vim25/xml/read.go +++ b/vendor/github.com/vmware/govmomi/vim25/xml/read.go @@ -1,4 +1,4 @@ -// Copyright 2009 The Go Authors. All rights reserved. +// Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -27,7 +27,7 @@ import ( // discarded. // // Because Unmarshal uses the reflect package, it can only assign -// to exported (upper case) fields. Unmarshal uses a case-sensitive +// to exported (upper case) fields. Unmarshal uses a case-sensitive // comparison to match XML element names to tag values and struct // field names. // @@ -37,9 +37,9 @@ import ( // // * If the struct has a field of type []byte or string with tag // ",innerxml", Unmarshal accumulates the raw XML nested inside the -// element in that field. The rest of the rules still apply. +// element in that field. The rest of the rules still apply. // -// * If the struct has a field named XMLName of type xml.Name, +// * If the struct has a field named XMLName of type Name, // Unmarshal records the element name in that field. // // * If the XMLName field has an associated tag of the form @@ -52,6 +52,11 @@ import ( // the explicit name in a struct field tag of the form "name,attr", // Unmarshal records the attribute value in that field. // +// * If the XML element has an attribute not handled by the previous +// rule and the struct has a field with an associated tag containing +// ",any,attr", Unmarshal records the attribute value in the first +// such field. +// // * If the XML element contains character data, that data is // accumulated in the first struct field that has tag ",chardata". // The struct field may have type []byte or string. @@ -59,7 +64,7 @@ import ( // // * If the XML element contains comments, they are accumulated in // the first struct field that has tag ",comment". The struct -// field may have type []byte or string. If there is no such +// field may have type []byte or string. If there is no such // field, the comments are discarded. // // * If the XML element contains a sub-element whose name matches @@ -85,7 +90,12 @@ import ( // * An anonymous struct field is handled as if the fields of its // value were part of the outer struct. // -// * A struct field with tag "-" is never unmarshalled into. +// * A struct field with tag "-" is never unmarshaled into. +// +// If Unmarshal encounters a field type that implements the Unmarshaler +// interface, Unmarshal calls its UnmarshalXML method to produce the value from +// the XML element. Otherwise, if the value implements +// encoding.TextUnmarshaler, Unmarshal calls that value's UnmarshalText method. // // Unmarshal maps an XML element to a string or []byte by saving the // concatenation of that element's character data in the string or @@ -94,34 +104,42 @@ import ( // Unmarshal maps an attribute value to a string or []byte by saving // the value in the string or slice. // -// Unmarshal maps an XML element to a slice by extending the length of -// the slice and mapping the element to the newly created value. +// Unmarshal maps an attribute value to an Attr by saving the attribute, +// including its name, in the Attr. +// +// Unmarshal maps an XML element or attribute value to a slice by +// extending the length of the slice and mapping the element or attribute +// to the newly created value. // // Unmarshal maps an XML element or attribute value to a bool by -// setting it to the boolean value represented by the string. +// setting it to the boolean value represented by the string. Whitespace +// is trimmed and ignored. // // Unmarshal maps an XML element or attribute value to an integer or // floating-point field by setting the field to the result of -// interpreting the string value in decimal. There is no check for -// overflow. +// interpreting the string value in decimal. There is no check for +// overflow. Whitespace is trimmed and ignored. // -// Unmarshal maps an XML element to an xml.Name by recording the -// element name. +// Unmarshal maps an XML element to a Name by recording the element +// name. // // Unmarshal maps an XML element to a pointer by setting the pointer // to a freshly allocated value and then mapping the element to that value. // +// A missing element or empty attribute value will be unmarshaled as a zero value. +// If the field is a slice, a zero value will be appended to the field. Otherwise, the +// field will be set to its zero value. func Unmarshal(data []byte, v interface{}) error { return NewDecoder(bytes.NewReader(data)).Decode(v) } -// Decode works like xml.Unmarshal, except it reads the decoder +// Decode works like Unmarshal, except it reads the decoder // stream to find the start element. func (d *Decoder) Decode(v interface{}) error { return d.DecodeElement(v, nil) } -// DecodeElement works like xml.Unmarshal except that it takes +// DecodeElement works like Unmarshal except that it takes // a pointer to the start XML element to decode into v. // It is useful when a client reads some raw XML tokens itself // but also wants to defer to Unmarshal for some elements. @@ -133,7 +151,7 @@ func (d *Decoder) DecodeElement(v interface{}, start *StartElement) error { return d.unmarshal(val.Elem(), start) } -// An UnmarshalError represents an error in the unmarshalling process. +// An UnmarshalError represents an error in the unmarshaling process. type UnmarshalError string func (e UnmarshalError) Error() string { return string(e) } @@ -148,7 +166,7 @@ func (e UnmarshalError) Error() string { return string(e) } // UnmarshalXML must consume exactly one XML element. // One common implementation strategy is to unmarshal into // a separate value with a layout matching the expected XML -// using d.DecodeElement, and then to copy the data from +// using d.DecodeElement, and then to copy the data from // that value into the receiver. // Another common strategy is to use d.Token to process the // XML object one token at a time. @@ -180,19 +198,19 @@ func receiverType(val interface{}) string { // unmarshalInterface unmarshals a single XML element into val. // start is the opening tag of the element. -func (p *Decoder) unmarshalInterface(val Unmarshaler, start *StartElement) error { +func (d *Decoder) unmarshalInterface(val Unmarshaler, start *StartElement) error { // Record that decoder must stop at end tag corresponding to start. - p.pushEOF() + d.pushEOF() - p.unmarshalDepth++ - err := val.UnmarshalXML(p, *start) - p.unmarshalDepth-- + d.unmarshalDepth++ + err := val.UnmarshalXML(d, *start) + d.unmarshalDepth-- if err != nil { - p.popEOF() + d.popEOF() return err } - if !p.popEOF() { + if !d.popEOF() { return fmt.Errorf("xml: %s.UnmarshalXML did not consume entire <%s> element", receiverType(val), start.Name.Local) } @@ -202,11 +220,11 @@ func (p *Decoder) unmarshalInterface(val Unmarshaler, start *StartElement) error // unmarshalTextInterface unmarshals a single XML element into val. // The chardata contained in the element (but not its children) // is passed to the text unmarshaler. -func (p *Decoder) unmarshalTextInterface(val encoding.TextUnmarshaler, start *StartElement) error { +func (d *Decoder) unmarshalTextInterface(val encoding.TextUnmarshaler) error { var buf []byte depth := 1 for depth > 0 { - t, err := p.Token() + t, err := d.Token() if err != nil { return err } @@ -225,14 +243,13 @@ func (p *Decoder) unmarshalTextInterface(val encoding.TextUnmarshaler, start *St } // unmarshalAttr unmarshals a single XML attribute into val. -func (p *Decoder) unmarshalAttr(val reflect.Value, attr Attr) error { +func (d *Decoder) unmarshalAttr(val reflect.Value, attr Attr) error { if val.Kind() == reflect.Ptr { if val.IsNil() { val.Set(reflect.New(val.Type().Elem())) } val = val.Elem() } - if val.CanInterface() && val.Type().Implements(unmarshalerAttrType) { // This is an unmarshaler with a non-pointer receiver, // so it's likely to be incorrect, but we do what we're told. @@ -258,11 +275,30 @@ func (p *Decoder) unmarshalAttr(val reflect.Value, attr Attr) error { } } - copyValue(val, []byte(attr.Value)) - return nil + if val.Type().Kind() == reflect.Slice && val.Type().Elem().Kind() != reflect.Uint8 { + // Slice of element values. + // Grow slice. + n := val.Len() + val.Set(reflect.Append(val, reflect.Zero(val.Type().Elem()))) + + // Recur to read element into slice. + if err := d.unmarshalAttr(val.Index(n), attr); err != nil { + val.SetLen(n) + return err + } + return nil + } + + if val.Type() == attrType { + val.Set(reflect.ValueOf(attr)) + return nil + } + + return copyValue(val, []byte(attr.Value)) } var ( + attrType = reflect.TypeOf(Attr{}) unmarshalerType = reflect.TypeOf((*Unmarshaler)(nil)).Elem() unmarshalerAttrType = reflect.TypeOf((*UnmarshalerAttr)(nil)).Elem() textUnmarshalerType = reflect.TypeOf((*encoding.TextUnmarshaler)(nil)).Elem() @@ -271,21 +307,9 @@ var ( // Find reflect.Type for an element's type attribute. func (p *Decoder) typeForElement(val reflect.Value, start *StartElement) reflect.Type { t := "" - for i, a := range start.Attr { + for _, a := range start.Attr { if a.Name == xmlSchemaInstance || a.Name == xsiType { t = a.Value - // HACK: ensure xsi:type is last in the list to avoid using that value for - // a "type" attribute, such as ManagedObjectReference.Type for example. - // Note that xsi:type is already the last attribute in VC/ESX responses. - // This is only an issue with govmomi simulator generated responses. - // Proper fix will require finding a few needles in this xml package haystack. - // Note: govmomi uses xmlSchemaInstance, other clients (e.g. rbvmomi) use xsiType. - // They are the same thing to XML parsers, but not to this hack here. - x := len(start.Attr) - 1 - if i != x { - start.Attr[i] = start.Attr[x] - start.Attr[x] = a - } break } } @@ -312,11 +336,11 @@ func (p *Decoder) typeForElement(val reflect.Value, start *StartElement) reflect } // Unmarshal a single XML element into val. -func (p *Decoder) unmarshal(val reflect.Value, start *StartElement) error { +func (d *Decoder) unmarshal(val reflect.Value, start *StartElement) error { // Find start element if we need it. if start == nil { for { - tok, err := p.Token() + tok, err := d.Token() if err != nil { return err } @@ -329,10 +353,10 @@ func (p *Decoder) unmarshal(val reflect.Value, start *StartElement) error { // Try to figure out type for empty interface values. if val.Kind() == reflect.Interface && val.IsNil() { - typ := p.typeForElement(val, start) + typ := d.typeForElement(val, start) if typ != nil { pval := reflect.New(typ).Elem() - err := p.unmarshal(pval, start) + err := d.unmarshal(pval, start) if err != nil { return err } @@ -371,24 +395,24 @@ func (p *Decoder) unmarshal(val reflect.Value, start *StartElement) error { if val.CanInterface() && val.Type().Implements(unmarshalerType) { // This is an unmarshaler with a non-pointer receiver, // so it's likely to be incorrect, but we do what we're told. - return p.unmarshalInterface(val.Interface().(Unmarshaler), start) + return d.unmarshalInterface(val.Interface().(Unmarshaler), start) } if val.CanAddr() { pv := val.Addr() if pv.CanInterface() && pv.Type().Implements(unmarshalerType) { - return p.unmarshalInterface(pv.Interface().(Unmarshaler), start) + return d.unmarshalInterface(pv.Interface().(Unmarshaler), start) } } if val.CanInterface() && val.Type().Implements(textUnmarshalerType) { - return p.unmarshalTextInterface(val.Interface().(encoding.TextUnmarshaler), start) + return d.unmarshalTextInterface(val.Interface().(encoding.TextUnmarshaler)) } if val.CanAddr() { pv := val.Addr() if pv.CanInterface() && pv.Type().Implements(textUnmarshalerType) { - return p.unmarshalTextInterface(pv.Interface().(encoding.TextUnmarshaler), start) + return d.unmarshalTextInterface(pv.Interface().(encoding.TextUnmarshaler)) } } @@ -414,7 +438,7 @@ func (p *Decoder) unmarshal(val reflect.Value, start *StartElement) error { // TODO: For now, simply ignore the field. In the near // future we may choose to unmarshal the start // element on it, if not nil. - return p.Skip() + return d.Skip() case reflect.Slice: typ := v.Type() @@ -427,19 +451,10 @@ func (p *Decoder) unmarshal(val reflect.Value, start *StartElement) error { // Slice of element values. // Grow slice. n := v.Len() - if n >= v.Cap() { - ncap := 2 * n - if ncap < 4 { - ncap = 4 - } - new := reflect.MakeSlice(typ, n, ncap) - reflect.Copy(new, v) - v.Set(new) - } - v.SetLen(n + 1) + v.Set(reflect.Append(val, reflect.Zero(v.Type().Elem()))) // Recur to read element into slice. - if err := p.unmarshal(v.Index(n), start); err != nil { + if err := d.unmarshal(v.Index(n), start); err != nil { v.SetLen(n) return err } @@ -476,52 +491,74 @@ func (p *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)) } } // Assign attributes. - // Also, determine whether we need to save character data or comments. + for _, a := range start.Attr { + handled := false + any := -1 + for i := range tinfo.fields { + finfo := &tinfo.fields[i] + switch finfo.flags & fMode { + case fAttr: + 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. + if needTypeAttr || (a.Name != xmlSchemaInstance && a.Name != xsiType) { + if err := d.unmarshalAttr(strv, a); err != nil { + return err + } + } + handled = true + } + + case fAny | fAttr: + if any == -1 { + any = i + } + } + } + if !handled && any >= 0 { + finfo := &tinfo.fields[any] + strv := finfo.value(sv, initNilPointers) + if err := d.unmarshalAttr(strv, a); err != nil { + return err + } + } + } + + // Determine whether we need to save character data or comments. for i := range tinfo.fields { finfo := &tinfo.fields[i] switch finfo.flags & fMode { - case fAttr: - strv := finfo.value(sv) - // Look for attribute. - for _, a := range start.Attr { - if a.Name.Local == finfo.name && (finfo.xmlns == "" || finfo.xmlns == a.Name.Space) { - if err := p.unmarshalAttr(strv, a); err != nil { - return err - } - break - } - } - - case fCharData: + 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) - if p.saved == nil { + saveXML = finfo.value(sv, initNilPointers) + if d.saved == nil { saveXMLIndex = 0 - p.saved = new(bytes.Buffer) + d.saved = new(bytes.Buffer) } else { - saveXMLIndex = p.savedOffset() + saveXMLIndex = d.savedOffset() } } } @@ -534,9 +571,9 @@ Loop: for { var savedOffset int if saveXML.IsValid() { - savedOffset = p.savedOffset() + savedOffset = d.savedOffset() } - tok, err := p.Token() + tok, err := d.Token() if err != nil { return err } @@ -544,28 +581,28 @@ Loop: case StartElement: consumed := false if sv.IsValid() { - consumed, err = p.unmarshalPath(tinfo, sv, nil, &t) + consumed, err = d.unmarshalPath(tinfo, sv, nil, &t) if err != nil { return err } if !consumed && saveAny.IsValid() { consumed = true - if err := p.unmarshal(saveAny, &t); err != nil { + if err := d.unmarshal(saveAny, &t); err != nil { return err } } } if !consumed { - if err := p.Skip(); err != nil { + if err := d.Skip(); err != nil { return err } } case EndElement: if saveXML.IsValid() { - saveXMLData = p.saved.Bytes()[saveXMLIndex:savedOffset] + saveXMLData = d.saved.Bytes()[saveXMLIndex:savedOffset] if saveXMLIndex == 0 { - p.saved = nil + d.saved = nil } } break Loop @@ -614,7 +651,9 @@ Loop: case reflect.String: t.SetString(string(saveXMLData)) case reflect.Slice: - t.Set(reflect.ValueOf(saveXMLData)) + if t.Type().Elem().Kind() == reflect.Uint8 { + t.Set(reflect.ValueOf(saveXMLData)) + } } return nil @@ -637,7 +676,11 @@ func copyValue(dst reflect.Value, src []byte) (err error) { default: return errors.New("cannot unmarshal into " + dst0.Type().String()) case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64: - itmp, err := strconv.ParseInt(string(src), 10, dst.Type().Bits()) + if len(src) == 0 { + dst.SetInt(0) + return nil + } + itmp, err := strconv.ParseInt(strings.TrimSpace(string(src)), 10, dst.Type().Bits()) if err != nil { return err } @@ -663,19 +706,32 @@ func copyValue(dst reflect.Value, src []byte) (err error) { utmp = uint64(uint64(itmp)) } } else { - utmp, err = strconv.ParseUint(string(src), 10, dst.Type().Bits()) + if len(src) == 0 { + dst.SetUint(0) + return nil + } + + utmp, err = strconv.ParseUint(strings.TrimSpace(string(src)), 10, dst.Type().Bits()) if err != nil { return err } } dst.SetUint(utmp) case reflect.Float32, reflect.Float64: - ftmp, err := strconv.ParseFloat(string(src), dst.Type().Bits()) + if len(src) == 0 { + dst.SetFloat(0) + return nil + } + ftmp, err := strconv.ParseFloat(strings.TrimSpace(string(src)), dst.Type().Bits()) if err != nil { return err } dst.SetFloat(ftmp) case reflect.Bool: + if len(src) == 0 { + dst.SetBool(false) + return nil + } value, err := strconv.ParseBool(strings.TrimSpace(string(src))) if err != nil { return err @@ -698,7 +754,7 @@ func copyValue(dst reflect.Value, src []byte) (err error) { // The consumed result tells whether XML elements have been consumed // from the Decoder until start's matching end element, or if it's // still untouched because start is uninteresting for sv's fields. -func (p *Decoder) unmarshalPath(tinfo *typeInfo, sv reflect.Value, parents []string, start *StartElement) (consumed bool, err error) { +func (d *Decoder) unmarshalPath(tinfo *typeInfo, sv reflect.Value, parents []string, start *StartElement) (consumed bool, err error) { recurse := false Loop: for i := range tinfo.fields { @@ -713,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, p.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 @@ -736,18 +792,18 @@ Loop: // prefix. Recurse and attempt to match these. for { var tok Token - tok, err = p.Token() + tok, err = d.Token() if err != nil { return true, err } switch t := tok.(type) { case StartElement: - consumed2, err := p.unmarshalPath(tinfo, sv, parents, &t) + consumed2, err := d.unmarshalPath(tinfo, sv, parents, &t) if err != nil { return true, err } if !consumed2 { - if err := p.Skip(); err != nil { + if err := d.Skip(); err != nil { return true, err } } diff --git a/vendor/github.com/vmware/govmomi/vim25/xml/typeinfo.go b/vendor/github.com/vmware/govmomi/vim25/xml/typeinfo.go index 086e83b6991..5eb0b4e5fdf 100644 --- a/vendor/github.com/vmware/govmomi/vim25/xml/typeinfo.go +++ b/vendor/github.com/vmware/govmomi/vim25/xml/typeinfo.go @@ -1,4 +1,4 @@ -// Copyright 2011 The Go Authors. All rights reserved. +// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -31,37 +31,37 @@ type fieldFlags int const ( fElement fieldFlags = 1 << iota fAttr + fCDATA fCharData - fInnerXml + fInnerXML fComment fAny fOmitEmpty fTypeAttr - fMode = fElement | fAttr | fCharData | fInnerXml | fComment | fAny + fMode = fElement | fAttr | fCDATA | fCharData | fInnerXML | fComment | fAny + + xmlName = "XMLName" ) -var tinfoMap = make(map[reflect.Type]*typeInfo) -var tinfoLock sync.RWMutex +var tinfoMap sync.Map // map[reflect.Type]*typeInfo var nameType = reflect.TypeOf(Name{}) // getTypeInfo returns the typeInfo structure with details necessary -// for marshalling and unmarshalling typ. +// for marshaling and unmarshaling typ. func getTypeInfo(typ reflect.Type) (*typeInfo, error) { - tinfoLock.RLock() - tinfo, ok := tinfoMap[typ] - tinfoLock.RUnlock() - if ok { - return tinfo, nil + if ti, ok := tinfoMap.Load(typ); ok { + return ti.(*typeInfo), nil } - tinfo = &typeInfo{} + + tinfo := &typeInfo{} if typ.Kind() == reflect.Struct && typ != nameType { n := typ.NumField() for i := 0; i < n; i++ { f := typ.Field(i) - if f.PkgPath != "" || f.Tag.Get("xml") == "-" { + if (f.PkgPath != "" && !f.Anonymous) || f.Tag.Get("xml") == "-" { continue // Private field } @@ -94,7 +94,7 @@ func getTypeInfo(typ reflect.Type) (*typeInfo, error) { return nil, err } - if f.Name == "XMLName" { + if f.Name == xmlName { tinfo.xmlname = finfo continue } @@ -105,10 +105,9 @@ func getTypeInfo(typ reflect.Type) (*typeInfo, error) { } } } - tinfoLock.Lock() - tinfoMap[typ] = tinfo - tinfoLock.Unlock() - return tinfo, nil + + ti, _ := tinfoMap.LoadOrStore(typ, tinfo) + return ti.(*typeInfo), nil } // structFieldInfo builds and returns a fieldInfo for f. @@ -131,10 +130,12 @@ func structFieldInfo(typ reflect.Type, f *reflect.StructField) (*fieldInfo, erro switch flag { case "attr": finfo.flags |= fAttr + case "cdata": + finfo.flags |= fCDATA case "chardata": finfo.flags |= fCharData case "innerxml": - finfo.flags |= fInnerXml + finfo.flags |= fInnerXML case "comment": finfo.flags |= fComment case "any": @@ -151,8 +152,8 @@ func structFieldInfo(typ reflect.Type, f *reflect.StructField) (*fieldInfo, erro switch mode := finfo.flags & fMode; mode { case 0: finfo.flags |= fElement - case fAttr, fCharData, fInnerXml, fComment, fAny: - if f.Name == "XMLName" || tag != "" && mode != fAttr { + case fAttr, fCDATA, fCharData, fInnerXML, fComment, fAny, fAny | fAttr: + if f.Name == xmlName || tag != "" && mode != fAttr { valid = false } default: @@ -177,7 +178,7 @@ func structFieldInfo(typ reflect.Type, f *reflect.StructField) (*fieldInfo, erro f.Name, typ, f.Tag.Get("xml")) } - if f.Name == "XMLName" { + if f.Name == xmlName { // The XMLName field records the XML element name. Don't // process it as usual because its name should default to // empty rather than to the field name. @@ -214,7 +215,7 @@ func structFieldInfo(typ reflect.Type, f *reflect.StructField) (*fieldInfo, erro } // If the field type has an XMLName field, the names must match - // so that the behavior of both marshalling and unmarshalling + // so that the behavior of both marshaling and unmarshaling // is straightforward and unambiguous. if finfo.flags&fElement != 0 { ftyp := f.Type @@ -239,11 +240,11 @@ func lookupXMLName(typ reflect.Type) (xmlname *fieldInfo) { } for i, n := 0, typ.NumField(); i < n; i++ { f := typ.Field(i) - if f.Name != "XMLName" { + if f.Name != xmlName { continue } finfo, err := structFieldInfo(typ, &f) - if finfo.name != "" && err == nil { + if err == nil && finfo.name != "" { return finfo } // Also consider errors as a non-existent field tag @@ -334,7 +335,7 @@ Loop: return nil } -// A TagPathError represents an error in the unmarshalling process +// A TagPathError represents an error in the unmarshaling process // caused by the use of field tags with conflicting paths. type TagPathError struct { Struct reflect.Type @@ -346,15 +347,25 @@ func (e *TagPathError) Error() string { return fmt.Sprintf("%s field %q with tag %q conflicts with field %q with tag %q", e.Struct, e.Field1, e.Tag1, e.Field2, e.Tag2) } +const ( + initNilPointers = true + dontInitNilPointers = false +) + // value returns v's field value corresponding to finfo. -// It's equivalent to v.FieldByIndex(finfo.idx), but initializes -// and dereferences pointers as necessary. -func (finfo *fieldInfo) value(v reflect.Value) reflect.Value { +// It's equivalent to v.FieldByIndex(finfo.idx), but when passed +// initNilPointers, it initializes and dereferences pointers as necessary. +// When passed dontInitNilPointers and a nil pointer is reached, the function +// returns a zero reflect.Value. +func (finfo *fieldInfo) value(v reflect.Value, shouldInitNilPointers bool) reflect.Value { for i, x := range finfo.idx { if i > 0 { t := v.Type() if t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Struct { if v.IsNil() { + if !shouldInitNilPointers { + return reflect.Value{} + } v.Set(reflect.New(v.Type().Elem())) } v = v.Elem() diff --git a/vendor/github.com/vmware/govmomi/vim25/xml/xml.go b/vendor/github.com/vmware/govmomi/vim25/xml/xml.go index 6c6c5c8212b..28631bdfe4a 100644 --- a/vendor/github.com/vmware/govmomi/vim25/xml/xml.go +++ b/vendor/github.com/vmware/govmomi/vim25/xml/xml.go @@ -7,8 +7,8 @@ package xml // References: -// Annotated XML spec: http://www.xml.com/axml/testaxml.htm -// XML name spaces: http://www.w3.org/TR/REC-xml-names/ +// Annotated XML spec: https://www.xml.com/axml/testaxml.htm +// XML name spaces: https://www.w3.org/TR/REC-xml-names/ // TODO(rsc): // Test error handling. @@ -61,6 +61,7 @@ type StartElement struct { Attr []Attr } +// Copy creates a new copy of StartElement. func (e StartElement) Copy() StartElement { attrs := make([]Attr, len(e.Attr)) copy(attrs, e.Attr) @@ -89,12 +90,14 @@ func makeCopy(b []byte) []byte { return b1 } +// Copy creates a new copy of CharData. func (c CharData) Copy() CharData { return CharData(makeCopy(c)) } // A Comment represents an XML comment of the form . // The bytes do not include the comment markers. type Comment []byte +// Copy creates a new copy of Comment. func (c Comment) Copy() Comment { return Comment(makeCopy(c)) } // A ProcInst represents an XML processing instruction of the form @@ -103,6 +106,7 @@ type ProcInst struct { Inst []byte } +// Copy creates a new copy of ProcInst. func (p ProcInst) Copy() ProcInst { p.Inst = makeCopy(p.Inst) return p @@ -112,6 +116,7 @@ func (p ProcInst) Copy() ProcInst { // The bytes do not include the markers. type Directive []byte +// Copy creates a new copy of Directive. func (d Directive) Copy() Directive { return Directive(makeCopy(d)) } // CopyToken returns a copy of a Token. @@ -131,6 +136,23 @@ func CopyToken(t Token) Token { return t } +// A TokenReader is anything that can decode a stream of XML tokens, including a +// Decoder. +// +// When Token encounters an error or end-of-file condition after successfully +// reading a token, it returns the token. It may return the (non-nil) error from +// the same call or return the error (and a nil token) from a subsequent call. +// An instance of this general case is that a TokenReader returning a non-nil +// token at the end of the token stream may return either io.EOF or a nil error. +// The next Read should return nil, io.EOF. +// +// Implementations of Token are discouraged from returning a nil token with a +// nil error. Callers should treat a return of nil, nil as indicating that +// nothing happened; in particular it does not indicate EOF. +type TokenReader interface { + Token() (Token, error) +} + // A Decoder represents an XML parser reading a particular input stream. // The parser assumes that its input is encoded in UTF-8. type Decoder struct { @@ -146,9 +168,9 @@ type Decoder struct { // // Setting: // - // d.Strict = false; - // d.AutoClose = HTMLAutoClose; - // d.Entity = HTMLEntity + // d.Strict = false + // d.AutoClose = xml.HTMLAutoClose + // d.Entity = xml.HTMLEntity // // creates a parser that can handle typical HTML. // @@ -177,7 +199,7 @@ type Decoder struct { // charset-conversion readers, converting from the provided // non-UTF-8 charset into UTF-8. If CharsetReader is nil or // returns an error, parsing stops with an error. One of the - // the CharsetReader's result values must be non-nil. + // CharsetReader's result values must be non-nil. CharsetReader func(charset string, input io.Reader) (io.Reader, error) // DefaultSpace sets the default name space used for unadorned tags, @@ -189,6 +211,7 @@ type Decoder struct { TypeFunc func(string) (reflect.Type, bool) r io.ByteReader + t TokenReader buf bytes.Buffer saved *bytes.Buffer stk *stack @@ -200,6 +223,7 @@ type Decoder struct { ns map[string]string err error line int + offset int64 unmarshalDepth int } @@ -217,12 +241,28 @@ func NewDecoder(r io.Reader) *Decoder { return d } +// NewTokenDecoder creates a new XML parser using an underlying token stream. +func NewTokenDecoder(t TokenReader) *Decoder { + // Is it already a Decoder? + if d, ok := t.(*Decoder); ok { + return d + } + d := &Decoder{ + ns: make(map[string]string), + t: t, + nextByte: -1, + line: 1, + Strict: true, + } + return d +} + // Token returns the next XML token in the input stream. // At the end of the input stream, Token returns nil, io.EOF. // // Slices of bytes in the returned token data refer to the // parser's internal buffer and remain valid only until the next -// call to Token. To acquire a copy of the bytes, call CopyToken +// call to Token. To acquire a copy of the bytes, call CopyToken // or the token's Copy method. // // Token expands self-closing elements such as
@@ -230,25 +270,33 @@ func NewDecoder(r io.Reader) *Decoder { // // Token guarantees that the StartElement and EndElement // tokens it returns are properly nested and matched: -// if Token encounters an unexpected end element, +// if Token encounters an unexpected end element +// or EOF before all expected end elements, // it will return an error. // // Token implements XML name spaces as described by -// http://www.w3.org/TR/REC-xml-names/. Each of the +// https://www.w3.org/TR/REC-xml-names/. Each of the // Name structures contained in the Token has the Space // set to the URL identifying its name space when known. // If Token encounters an unrecognized name space prefix, // it uses the prefix as the Space rather than report an error. -func (d *Decoder) Token() (t Token, err error) { +func (d *Decoder) Token() (Token, error) { + var t Token + var err error if d.stk != nil && d.stk.kind == stkEOF { - err = io.EOF - return + return nil, io.EOF } if d.nextToken != nil { t = d.nextToken d.nextToken = nil } else if t, err = d.rawToken(); err != nil { - return + 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 } if !d.Strict { @@ -264,12 +312,12 @@ func (d *Decoder) Token() (t Token, err error) { // to the other attribute names, so process // the translations first. for _, a := range t1.Attr { - if a.Name.Space == "xmlns" { + if a.Name.Space == xmlnsPrefix { v, ok := d.ns[a.Name.Local] d.pushNs(a.Name.Local, v, ok) d.ns[a.Name.Local] = a.Value } - if a.Name.Space == "" && a.Name.Local == "xmlns" { + if a.Name.Space == "" && a.Name.Local == xmlnsPrefix { // Default space for untagged names v, ok := d.ns[""] d.pushNs("", v, ok) @@ -291,23 +339,27 @@ func (d *Decoder) Token() (t Token, err error) { } t = t1 } - return + return t, err } -const xmlURL = "http://www.w3.org/XML/1998/namespace" +const ( + xmlURL = "http://www.w3.org/XML/1998/namespace" + xmlnsPrefix = "xmlns" + xmlPrefix = "xml" +) // Apply name space translation to name n. // The default name space (for Space=="") // applies only to element names, not to attribute names. func (d *Decoder) translate(n *Name, isElementName bool) { switch { - case n.Space == "xmlns": + case n.Space == xmlnsPrefix: return case n.Space == "" && !isElementName: return - case n.Space == "xml": + case n.Space == xmlPrefix: n.Space = xmlURL - case n.Space == "" && n.Local == "xmlns": + case n.Space == "" && n.Local == xmlnsPrefix: return } if v, ok := d.ns[n.Space]; ok { @@ -330,7 +382,7 @@ func (d *Decoder) switchToReader(r io.Reader) { } // Parsing state - stack holds old name space translations -// and the current set of open elements. The translations to pop when +// and the current set of open elements. The translations to pop when // ending a given tag are *below* it on the stack, which is // more work but forced on us by XML. type stack struct { @@ -501,6 +553,9 @@ func (d *Decoder) RawToken() (Token, error) { } func (d *Decoder) rawToken() (Token, error) { + if d.t != nil { + return d.t.Token() + } if d.err != nil { return nil, d.err } @@ -552,7 +607,6 @@ func (d *Decoder) rawToken() (Token, error) { case '?': // if target == "xml" { - enc := procInstEncoding(string(data)) - if enc != "" && enc != "utf-8" && enc != "UTF-8" { + content := string(data) + ver := procInst("version", content) + if ver != "" && ver != "1.0" { + d.err = fmt.Errorf("xml: unsupported version %q; only version 1.0 is supported", ver) + return nil, d.err + } + enc := procInst("encoding", content) + if enc != "" && enc != "utf-8" && enc != "UTF-8" && !strings.EqualFold(enc, "utf-8") { if d.CharsetReader == nil { d.err = fmt.Errorf("xml: encoding %q declared but Decoder.CharsetReader is nil", enc) return nil, d.err @@ -619,7 +679,12 @@ func (d *Decoder) rawToken() (Token, error) { return nil, d.err } d.buf.WriteByte(b) - if b0 == '-' && b1 == '-' && b == '>' { + if b0 == '-' && b1 == '-' { + if b != '>' { + d.err = d.syntaxError( + `invalid sequence "--" not allowed in comments`) + return nil, d.err + } break } b0, b1 = b1, b @@ -726,7 +791,7 @@ func (d *Decoder) rawToken() (Token, error) { return nil, d.err } - attr = make([]Attr, 0, 4) + attr = []Attr{} for { d.space() if b, ok = d.mustgetc(); !ok { @@ -748,14 +813,7 @@ func (d *Decoder) rawToken() (Token, error) { } d.ungetc(b) - n := len(attr) - if n >= cap(attr) { - nattr := make([]Attr, n, 2*cap(attr)) - copy(nattr, attr) - attr = nattr - } - attr = attr[0 : n+1] - a := &attr[n] + a := Attr{} if a.Name, ok = d.nsname(); !ok { if d.err == nil { d.err = d.syntaxError("expected attribute name in element") @@ -770,10 +828,9 @@ func (d *Decoder) rawToken() (Token, error) { if d.Strict { d.err = d.syntaxError("attribute name without = in element") return nil, d.err - } else { - d.ungetc(b) - a.Value = a.Name.Local } + d.ungetc(b) + a.Value = a.Name.Local } else { d.space() data := d.attrval() @@ -782,6 +839,7 @@ func (d *Decoder) rawToken() (Token, error) { } a.Value = string(data) } + attr = append(attr, a) } if empty { d.needClose = true @@ -812,7 +870,7 @@ func (d *Decoder) attrval() []byte { if !ok { return nil } - // http://www.w3.org/TR/REC-html40/intro/sgmltut.html#h-3.2.2 + // https://www.w3.org/TR/REC-html40/intro/sgmltut.html#h-3.2.2 if 'a' <= b && b <= 'z' || 'A' <= b && b <= 'Z' || '0' <= b && b <= '9' || b == '_' || b == ':' || b == '-' { d.buf.WriteByte(b) @@ -863,9 +921,17 @@ func (d *Decoder) getc() (b byte, ok bool) { if b == '\n' { d.line++ } + d.offset++ return b, true } +// InputOffset returns the input stream byte offset of the current decoder position. +// The offset gives the location of the end of the most recently returned token +// and the beginning of the next token. +func (d *Decoder) InputOffset() int64 { + return d.offset +} + // Return saved offset. // If we did ungetc (nextByte >= 0), have to back up one. func (d *Decoder) savedOffset() int { @@ -895,9 +961,10 @@ func (d *Decoder) ungetc(b byte) { d.line-- } d.nextByte = int(b) + d.offset-- } -var entity = map[string]int{ +var entity = map[string]rune{ "lt": '<', "gt": '>', "amp": '&', @@ -992,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 } } @@ -1002,7 +1069,6 @@ Input: if d.err != nil { return nil } - ok = false } if b, ok = d.mustgetc(); !ok { return nil @@ -1075,13 +1141,13 @@ Input: } // Decide whether the given rune is in the XML Character Range, per -// the Char production of http://www.xml.com/axml/testaxml.htm, +// the Char production of https://www.xml.com/axml/testaxml.htm, // Section 2.2 Characters. func isInCharacterRange(r rune) (inrange bool) { return r == 0x09 || r == 0x0A || r == 0x0D || - r >= 0x20 && r <= 0xDF77 || + r >= 0x20 && r <= 0xD7FF || r >= 0xE000 && r <= 0xFFFD || r >= 0x10000 && r <= 0x10FFFF } @@ -1113,12 +1179,12 @@ func (d *Decoder) name() (s string, ok bool) { } // Now we check the characters. - s = d.buf.String() - if !isName([]byte(s)) { - d.err = d.syntaxError("invalid XML name: " + s) + b := d.buf.Bytes() + if !isName(b) { + d.err = d.syntaxError("invalid XML name: " + string(b)) return "", false } - return s, true + return string(b), true } // Read a name and append its bytes to d.buf. @@ -1204,8 +1270,8 @@ func isNameString(s string) bool { } // These tables were generated by cut and paste from Appendix B of -// the XML spec at http://www.xml.com/axml/testaxml.htm -// and then reformatting. First corresponds to (Letter | '_' | ':') +// the XML spec at https://www.xml.com/axml/testaxml.htm +// and then reformatting. First corresponds to (Letter | '_' | ':') // and second corresponds to NameChar. var first = &unicode.RangeTable{ @@ -1522,7 +1588,9 @@ var second = &unicode.RangeTable{ // HTMLEntity is an entity map containing translations for the // standard HTML entity characters. -var HTMLEntity = htmlEntity +// +// See the Decoder.Strict and Decoder.Entity fields' documentation. +var HTMLEntity map[string]string = htmlEntity var htmlEntity = map[string]string{ /* @@ -1789,7 +1857,9 @@ var htmlEntity = map[string]string{ // HTMLAutoClose is the set of HTML elements that // should be considered to close automatically. -var HTMLAutoClose = htmlAutoClose +// +// See the Decoder.Strict and Decoder.Entity fields' documentation. +var HTMLAutoClose []string = htmlAutoClose var htmlAutoClose = []string{ /* @@ -1812,20 +1882,27 @@ var htmlAutoClose = []string{ } var ( - esc_quot = []byte(""") // shorter than """ - esc_apos = []byte("'") // shorter than "'" - esc_amp = []byte("&") - esc_lt = []byte("<") - esc_gt = []byte(">") - esc_tab = []byte(" ") - esc_nl = []byte(" ") - esc_cr = []byte(" ") - esc_fffd = []byte("\uFFFD") // Unicode replacement character + escQuot = []byte(""") // shorter than """ + escApos = []byte("'") // shorter than "'" + escAmp = []byte("&") + escLT = []byte("<") + escGT = []byte(">") + escTab = []byte(" ") + escNL = []byte(" ") + escCR = []byte(" ") + escFFFD = []byte("\uFFFD") // Unicode replacement character ) // EscapeText writes to w the properly escaped XML equivalent // of the plain text data s. func EscapeText(w io.Writer, s []byte) error { + return escapeText(w, s, true) +} + +// escapeText writes to w the properly escaped XML equivalent +// of the plain text data s. If escapeNewline is true, newline +// characters will be escaped. +func escapeText(w io.Writer, s []byte, escapeNewline bool) error { var esc []byte last := 0 for i := 0; i < len(s); { @@ -1833,24 +1910,27 @@ func EscapeText(w io.Writer, s []byte) error { i += width switch r { case '"': - esc = esc_quot + esc = escQuot case '\'': - esc = esc_apos + esc = escApos case '&': - esc = esc_amp + esc = escAmp case '<': - esc = esc_lt + esc = escLT case '>': - esc = esc_gt + esc = escGT case '\t': - esc = esc_tab + esc = escTab case '\n': - esc = esc_nl + if !escapeNewline { + continue + } + esc = escNL case '\r': - esc = esc_cr + esc = escCR default: if !isInCharacterRange(r) || (r == 0xFFFD && width == 1) { - esc = esc_fffd + esc = escFFFD break } continue @@ -1863,10 +1943,8 @@ func EscapeText(w io.Writer, s []byte) error { } last = i } - if _, err := w.Write(s[last:]); err != nil { - return err - } - return nil + _, err := w.Write(s[last:]) + return err } // EscapeString writes to p the properly escaped XML equivalent @@ -1879,24 +1957,24 @@ func (p *printer) EscapeString(s string) { i += width switch r { case '"': - esc = esc_quot + esc = escQuot case '\'': - esc = esc_apos + esc = escApos case '&': - esc = esc_amp + esc = escAmp case '<': - esc = esc_lt + esc = escLT case '>': - esc = esc_gt + esc = escGT case '\t': - esc = esc_tab + esc = escTab case '\n': - esc = esc_nl + esc = escNL case '\r': - esc = esc_cr + esc = escCR default: if !isInCharacterRange(r) || (r == 0xFFFD && width == 1) { - esc = esc_fffd + esc = escFFFD break } continue @@ -1915,16 +1993,55 @@ func Escape(w io.Writer, s []byte) { EscapeText(w, s) } -// procInstEncoding parses the `encoding="..."` or `encoding='...'` +var ( + cdataStart = []byte("") + cdataEscape = []byte("]]]]>") +) + +// emitCDATA writes to w the CDATA-wrapped plain text data s. +// It escapes CDATA directives nested in s. +func emitCDATA(w io.Writer, s []byte) error { + if len(s) == 0 { + return nil + } + if _, err := w.Write(cdataStart); err != nil { + return err + } + for { + i := bytes.Index(s, cdataEnd) + if i >= 0 && i+len(cdataEnd) <= len(s) { + // Found a nested CDATA directive end. + if _, err := w.Write(s[:i]); err != nil { + return err + } + if _, err := w.Write(cdataEscape); err != nil { + return err + } + i += len(cdataEnd) + } else { + if _, err := w.Write(s); err != nil { + return err + } + break + } + s = s[i:] + } + _, err := w.Write(cdataEnd) + return err +} + +// procInst parses the `param="..."` or `param='...'` // value out of the provided string, returning "" if not found. -func procInstEncoding(s string) string { +func procInst(param, s string) string { // TODO: this parsing is somewhat lame and not exact. // It works for all actual cases, though. - idx := strings.Index(s, "encoding=") + param = param + "=" + idx := strings.Index(s, param) if idx == -1 { return "" } - v := s[idx+len("encoding="):] + v := s[idx+len(param):] if v == "" { return "" } diff --git a/vendor/modules.txt b/vendor/modules.txt index 41b5d8e2077..9a1cc63ac01 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -449,7 +449,7 @@ github.com/google/pprof/profile # github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 ## explicit; go 1.13 github.com/google/shlex -# github.com/google/uuid v1.1.2 +# github.com/google/uuid v1.3.0 ## explicit github.com/google/uuid # github.com/googleapis/gax-go/v2 v2.1.1 @@ -733,10 +733,13 @@ github.com/vishvananda/netlink/nl # github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae ## explicit; go 1.12 github.com/vishvananda/netns -# github.com/vmware/govmomi v0.20.3 -## explicit +# github.com/vmware/govmomi v0.30.0 +## explicit; go 1.17 github.com/vmware/govmomi github.com/vmware/govmomi/find +github.com/vmware/govmomi/history +github.com/vmware/govmomi/internal +github.com/vmware/govmomi/internal/version github.com/vmware/govmomi/list github.com/vmware/govmomi/lookup github.com/vmware/govmomi/lookup/methods @@ -744,22 +747,33 @@ github.com/vmware/govmomi/lookup/simulator github.com/vmware/govmomi/lookup/types 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/keepalive github.com/vmware/govmomi/simulator github.com/vmware/govmomi/simulator/esx +github.com/vmware/govmomi/simulator/internal github.com/vmware/govmomi/simulator/vpx github.com/vmware/govmomi/sts github.com/vmware/govmomi/sts/internal github.com/vmware/govmomi/sts/simulator github.com/vmware/govmomi/task +github.com/vmware/govmomi/toolbox/hgfs +github.com/vmware/govmomi/toolbox/process +github.com/vmware/govmomi/toolbox/vix +github.com/vmware/govmomi/units +github.com/vmware/govmomi/vapi github.com/vmware/govmomi/vapi/internal +github.com/vmware/govmomi/vapi/library github.com/vmware/govmomi/vapi/rest github.com/vmware/govmomi/vapi/simulator github.com/vmware/govmomi/vapi/tags +github.com/vmware/govmomi/vapi/vcenter +github.com/vmware/govmomi/view github.com/vmware/govmomi/vim25 github.com/vmware/govmomi/vim25/debug github.com/vmware/govmomi/vim25/methods