Skip to content

Commit

Permalink
Update generated types to vSphere 8.0 GA
Browse files Browse the repository at this point in the history
This patch updates the generated types to vSphere 8.0 GA.
  • Loading branch information
akutz committed Dec 12, 2022
1 parent b505edb commit dd2c301
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 32 deletions.
40 changes: 40 additions & 0 deletions eam/methods/methods.go
Expand Up @@ -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"`
Expand Down Expand Up @@ -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"`
Expand Down
31 changes: 31 additions & 0 deletions eam/types/types.go
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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"`
}
Expand All @@ -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
}
Expand Down Expand Up @@ -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"`
Expand All @@ -1341,6 +1369,9 @@ func init() {
types.Add("eam:SetMaintenanceModePolicyRequestType", reflect.TypeOf((*SetMaintenanceModePolicyRequestType)(nil)).Elem())
}

type SetMaintenanceModePolicyResponse struct {
}

type Uninstall UninstallRequestType

func init() {
Expand Down
6 changes: 3 additions & 3 deletions gen/gen.sh
Expand Up @@ -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"

Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions simulator/folder.go
Expand Up @@ -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 {
Expand Down Expand Up @@ -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{
Expand Down
24 changes: 12 additions & 12 deletions vim25/types/types.go
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
10 changes: 0 additions & 10 deletions vim25/types/unreleased.go
Expand Up @@ -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()
}

0 comments on commit dd2c301

Please sign in to comment.