From dd2c301bcbfe794c365e843f5b5e5267328ea0ec Mon Sep 17 00:00:00 2001 From: akutz Date: Sun, 11 Dec 2022 18:38:08 -0600 Subject: [PATCH] Update generated types to vSphere 8.0 GA This patch updates the generated types to vSphere 8.0 GA. --- eam/methods/methods.go | 40 +++++++++++++++++++++++++++++++++++++++ eam/types/types.go | 31 ++++++++++++++++++++++++++++++ gen/gen.sh | 6 +++--- simulator/folder.go | 14 +++++++------- vim25/types/types.go | 24 +++++++++++------------ vim25/types/unreleased.go | 10 ---------- 6 files changed, 93 insertions(+), 32 deletions(-) diff --git a/eam/methods/methods.go b/eam/methods/methods.go index edf67f1b0..7e968b2e1 100644 --- a/eam/methods/methods.go +++ b/eam/methods/methods.go @@ -183,6 +183,26 @@ func DestroyAgency(ctx context.Context, r soap.RoundTripper, req *types.DestroyA return resBody.Res, nil } +type GetMaintenanceModePolicyBody struct { + Req *types.GetMaintenanceModePolicy `xml:"urn:eam GetMaintenanceModePolicy,omitempty"` + Res *types.GetMaintenanceModePolicyResponse `xml:"urn:eam GetMaintenanceModePolicyResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *GetMaintenanceModePolicyBody) Fault() *soap.Fault { return b.Fault_ } + +func GetMaintenanceModePolicy(ctx context.Context, r soap.RoundTripper, req *types.GetMaintenanceModePolicy) (*types.GetMaintenanceModePolicyResponse, error) { + var reqBody, resBody GetMaintenanceModePolicyBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type MarkAsAvailableBody struct { Req *types.MarkAsAvailable `xml:"urn:eam MarkAsAvailable,omitempty"` Res *types.MarkAsAvailableResponse `xml:"urn:eam MarkAsAvailableResponse,omitempty"` @@ -383,6 +403,26 @@ func ScanForUnknownAgentVm(ctx context.Context, r soap.RoundTripper, req *types. return resBody.Res, nil } +type SetMaintenanceModePolicyBody struct { + Req *types.SetMaintenanceModePolicy `xml:"urn:eam SetMaintenanceModePolicy,omitempty"` + Res *types.SetMaintenanceModePolicyResponse `xml:"urn:eam SetMaintenanceModePolicyResponse,omitempty"` + Fault_ *soap.Fault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"` +} + +func (b *SetMaintenanceModePolicyBody) Fault() *soap.Fault { return b.Fault_ } + +func SetMaintenanceModePolicy(ctx context.Context, r soap.RoundTripper, req *types.SetMaintenanceModePolicy) (*types.SetMaintenanceModePolicyResponse, error) { + var reqBody, resBody SetMaintenanceModePolicyBody + + reqBody.Req = req + + if err := r.RoundTrip(ctx, &reqBody, &resBody); err != nil { + return nil, err + } + + return resBody.Res, nil +} + type UninstallBody struct { Req *types.Uninstall `xml:"urn:eam Uninstall,omitempty"` Res *types.UninstallResponse `xml:"urn:eam UninstallResponse,omitempty"` diff --git a/eam/types/types.go b/eam/types/types.go index ed8b2d3f4..1b130483a 100644 --- a/eam/types/types.go +++ b/eam/types/types.go @@ -582,6 +582,12 @@ func init() { types.Add("eam:DisabledClusterFault", reflect.TypeOf((*DisabledClusterFault)(nil)).Elem()) } +type DisabledClusterFaultFault DisabledClusterFault + +func init() { + types.Add("eam:DisabledClusterFaultFault", reflect.TypeOf((*DisabledClusterFaultFault)(nil)).Elem()) +} + type EamAppFault struct { EamRuntimeFault } @@ -646,6 +652,12 @@ func init() { types.Add("eam:EamInvalidState", reflect.TypeOf((*EamInvalidState)(nil)).Elem()) } +type EamInvalidStateFault EamInvalidState + +func init() { + types.Add("eam:EamInvalidStateFault", reflect.TypeOf((*EamInvalidStateFault)(nil)).Elem()) +} + type EamInvalidVibPackage struct { EamRuntimeFault } @@ -729,6 +741,12 @@ func init() { types.Add("eam:ExtensibleIssue", reflect.TypeOf((*ExtensibleIssue)(nil)).Elem()) } +type GetMaintenanceModePolicy GetMaintenanceModePolicyRequestType + +func init() { + types.Add("eam:GetMaintenanceModePolicy", reflect.TypeOf((*GetMaintenanceModePolicy)(nil)).Elem()) +} + type GetMaintenanceModePolicyRequestType struct { This types.ManagedObjectReference `xml:"_this"` } @@ -737,6 +755,10 @@ func init() { types.Add("eam:GetMaintenanceModePolicyRequestType", reflect.TypeOf((*GetMaintenanceModePolicyRequestType)(nil)).Elem()) } +type GetMaintenanceModePolicyResponse struct { + Returnval string `xml:"returnval"` +} + type HostInMaintenanceMode struct { VmDeployed } @@ -1332,6 +1354,12 @@ func init() { type ScanForUnknownAgentVmResponse struct { } +type SetMaintenanceModePolicy SetMaintenanceModePolicyRequestType + +func init() { + types.Add("eam:SetMaintenanceModePolicy", reflect.TypeOf((*SetMaintenanceModePolicy)(nil)).Elem()) +} + type SetMaintenanceModePolicyRequestType struct { This types.ManagedObjectReference `xml:"_this"` Policy string `xml:"policy"` @@ -1341,6 +1369,9 @@ func init() { types.Add("eam:SetMaintenanceModePolicyRequestType", reflect.TypeOf((*SetMaintenanceModePolicyRequestType)(nil)).Elem()) } +type SetMaintenanceModePolicyResponse struct { +} + type Uninstall UninstallRequestType func init() { diff --git a/gen/gen.sh b/gen/gen.sh index 6f8929124..b19345a7f 100755 --- a/gen/gen.sh +++ b/gen/gen.sh @@ -48,7 +48,7 @@ generate() { } # -# All types derive from vCenter build 20023987, vSphere 8.0. +# All types derive from vSphere 8.0 GA, vcenter-all build 20519528. # export COPYRIGHT_DATE_RANGE="2014-2022" @@ -59,14 +59,14 @@ export COPYRIGHT_DATE_RANGE="2014-2022" # export FORCE_BASE_INTERFACE_FOR_TYPES="AgencyConfigInfo" -# ./sdk/ contains the contents of wsdl.zip from vimbase build 19936444. +# ./sdk/ contains the contents of wsdl.zip from vimbase build 20031402. generate "../vim25" "vim" "./rbvmomi/vmodl.db" # from github.com/vmware/rbvmomi@v3.0.0 generate "../pbm" "pbm" generate "../vslm" "vslm" generate "../sms" "sms" # ./sdk/ contains the files eam-messagetypes.xsd and eam-types.xsd from -# eam-wsdl.zip, from eam-vcenter build 19970683. +# eam-wsdl.zip, from eam-vcenter build 20031438. # # Please note the EAM files are also available at the following, public URL -- # http://bit.ly/eam-sdk, therefore the WSDL resource for EAM are in fact diff --git a/simulator/folder.go b/simulator/folder.go index 88efac2c7..a30094383 100644 --- a/simulator/folder.go +++ b/simulator/folder.go @@ -807,12 +807,13 @@ func (f *Folder) PlaceVmsXCluster(ctx *Context, req *types.PlaceVmsXCluster) soa Target: &cluster.Self, } - placementAction := types.ClusterInitialPlacementAction{ - Pool: &pool.Self, + placementAction := types.ClusterClusterInitialPlacementAction{ + Pool: pool.Self, } if hostRequired { - placementAction.TargetHost = cluster.Host[rand.Intn(len(cluster.Host))] + randomHost := cluster.Host[rand.Intn(len(cluster.Host))] + placementAction.TargetHost = &randomHost } if datastoreRequired { @@ -856,12 +857,11 @@ func (f *Folder) PlaceVmsXCluster(ctx *Context, req *types.PlaceVmsXCluster) soa } } } + + placementAction.ConfigSpec = configSpec } - res.Action = append(res.Action, &types.ClusterClusterInitialPlacementAction{ - ClusterInitialPlacementAction: placementAction, - ConfigSpec: configSpec, - }) + res.Action = append(res.Action, &placementAction) body.Res.Returnval.PlacementInfos = append(body.Res.Returnval.PlacementInfos, types.PlaceVmsXClusterResultPlacementInfo{ diff --git a/vim25/types/types.go b/vim25/types/types.go index 30a58792b..f7ae195f7 100644 --- a/vim25/types/types.go +++ b/vim25/types/types.go @@ -8313,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 @@ -8835,18 +8847,6 @@ func init() { t["ClusterDasVmConfigSpec"] = reflect.TypeOf((*ClusterDasVmConfigSpec)(nil)).Elem() } -type ClusterDasVmPreemptiblePairInfo struct { - DynamicData - - Key int32 `xml:"key,omitempty"` - MonitoredVm ManagedObjectReference `xml:"monitoredVm"` - PreemptibleVm ManagedObjectReference `xml:"preemptibleVm"` -} - -func init() { - t["ClusterDasVmPreemptiblePairInfo"] = reflect.TypeOf((*ClusterDasVmPreemptiblePairInfo)(nil)).Elem() -} - type ClusterDasVmSettings struct { DynamicData diff --git a/vim25/types/unreleased.go b/vim25/types/unreleased.go index 9c9de58ae..72bc1082b 100644 --- a/vim25/types/unreleased.go +++ b/vim25/types/unreleased.go @@ -119,13 +119,3 @@ func init() { } const RecommendationReasonCodeXClusterPlacement = RecommendationReasonCode("xClusterPlacement") - -type ClusterClusterInitialPlacementAction struct { - ClusterInitialPlacementAction - - ConfigSpec *VirtualMachineConfigSpec `xml:"configSpec,omitempty"` -} - -func init() { - t["ClusterClusterInitialPlacementAction"] = reflect.TypeOf((*ClusterClusterInitialPlacementAction)(nil)).Elem() -}