Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update generated types to vSphere 8.0 GA #3006

Merged
merged 6 commits into from
Dec 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions eam/methods/methods.go
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion govc/about/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func (r *certResult) Write(w io.Writer) error {

func (cmd *cert) Run(ctx context.Context, f *flag.FlagSet) error {
u := cmd.Session.URL
c := soap.NewClient(u, false)
c := soap.NewClient(u, cmd.Session.Insecure)
t := c.Client.Transport.(*http.Transport)
r := certResult{cmd: cmd}

Expand Down
1 change: 1 addition & 0 deletions govc/namespace/cluster/enable.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ func (cmd *enableCluster) toVapiSpec(refs objectReferences) (*namespace.EnableCl
if (cmd.ControlPlaneManagementNetwork.Mode != "") ||
(cmd.ControlPlaneManagementNetwork.FloatingIP != "") ||
(cmd.ControlPlaneManagementNetwork.Network != "") {
masterManagementNetwork = &namespace.MasterManagementNetwork{}
masterManagementNetwork.AddressRange = cmd.ControlPlaneManagementNetwork.AddressRange
masterManagementNetwork.FloatingIP = cmd.ControlPlaneManagementNetwork.FloatingIP
ipam := namespace.IpAssignmentModeFromString(cmd.ControlPlaneManagementNetwork.Mode)
Expand Down
4 changes: 4 additions & 0 deletions govc/namespace/cluster/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ func (cmd *logs) Run(ctx context.Context, f *flag.FlagSet) error {
return err
}

if id := c.SessionID(); id != "" {
req.Header.Set("vmware-api-session-id", id)
}

return c.Client.Do(ctx, req, func(res *http.Response) error {
if name == "" {
d := res.Header.Get("Content-Disposition")
Expand Down
6 changes: 3 additions & 3 deletions govc/test/import.bats
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ load test_helper
assert_success

# ensure vcsim doesn't panic without capacityAllocationUnits
dir=$($mktemp --tmpdir -d govc-test-XXXXX)
dir=$($mktemp --tmpdir -d govc-test-XXXXX 2>/dev/null || $mktemp -d -t govc-test-XXXXX)
sed -e s/capacityAllocationUnits/invalid/ "$GOVC_IMAGES/$TTYLINUX_NAME.ovf" > "$dir/$TTYLINUX_NAME.ovf"
touch "$dir/$TTYLINUX_NAME-disk1.vmdk" # .vmdk contents don't matter to vcsim
run govc import.ovf "$dir/$TTYLINUX_NAME.ovf"
Expand All @@ -98,7 +98,7 @@ load test_helper
vcsim_env

name=$(new_id)
file=$($mktemp --tmpdir govc-test-XXXXX)
file=$($mktemp --tmpdir govc-test-XXXXX 2>/dev/null || $mktemp -t govc-test-XXXXX)
echo "{ \"Name\": \"${name}\"}" > ${file}

run govc import.ovf -options="${file}" $GOVC_IMAGES/${TTYLINUX_NAME}.ovf
Expand All @@ -113,7 +113,7 @@ load test_helper
@test "import.ovf with import.spec result" {
vcsim_env

file=$($mktemp --tmpdir govc-test-XXXXX)
file=$($mktemp --tmpdir govc-test-XXXXX 2>/dev/null || $mktemp -t govc-test-XXXXX)
name=$(new_id)

govc import.spec $GOVC_IMAGES/${TTYLINUX_NAME}.ovf > ${file}
Expand Down
8 changes: 4 additions & 4 deletions govc/test/namespace.bats
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ load test_helper
vcsim_env

# need to set up some dependencies
govc cluster.create Workload-Cluster
govc cluster.create WCP-Cluster
akutz marked this conversation as resolved.
Show resolved Hide resolved
assert_success

govc dvs.create "DVPG-Management Network"
Expand All @@ -41,7 +41,7 @@ load test_helper
govc namespace.cluster.enable \
--service-cidr 10.96.0.0/23 \
--pod-cidrs 10.244.0.0/20 \
--cluster "Workload-Cluster" \
--cluster "WCP-Cluster" \
--control-plane-dns 8.8.8.8 \
--worker-dns 8.8.8.8 \
--control-plane-dns-search-domains example.com \
Expand All @@ -67,10 +67,10 @@ load test_helper
@test "namespace.cluster.disable" {
vcsim_env

govc cluster.create Workload-Cluster
govc cluster.create WCP-Cluster
assert_success

govc namespace.cluster.disable --cluster Workload-Cluster
govc namespace.cluster.disable --cluster WCP-Cluster
assert_success
}

Expand Down
8 changes: 4 additions & 4 deletions govc/test/session.bats
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ load test_helper
@test "session.rm" {
vcsim_env

dir=$($mktemp --tmpdir -d govc-test-XXXXX)
dir=$($mktemp --tmpdir -d govc-test-XXXXX 2>/dev/null || $mktemp -d -t govc-test-XXXXX)
export GOVMOMI_HOME="$dir"
export GOVC_PERSIST_SESSION=true

Expand All @@ -48,7 +48,7 @@ load test_helper
@test "session.persist" {
vcsim_env

dir=$($mktemp --tmpdir -d govc-test-XXXXX)
dir=$($mktemp --tmpdir -d govc-test-XXXXX 2>/dev/null || $mktemp -d -t govc-test-XXXXX)
export GOVMOMI_HOME="$dir"
export GOVC_PERSIST_SESSION=true

Expand Down Expand Up @@ -102,7 +102,7 @@ load test_helper
assert_success

user=$(govc env GOVC_USERNAME)
dir=$($mktemp --tmpdir -d govc-test-XXXXX)
dir=$($mktemp --tmpdir -d govc-test-XXXXX 2>/dev/null || $mktemp -d -t govc-test-XXXXX)
export GOVMOMI_HOME="$dir"
export GOVC_PERSIST_SESSION=true

Expand Down Expand Up @@ -137,7 +137,7 @@ load test_helper
vcsim_env

user=$(govc env GOVC_USERNAME)
dir=$($mktemp --tmpdir -d govc-test-XXXXX)
dir=$($mktemp --tmpdir -d govc-test-XXXXX 2>/dev/null || $mktemp -d -t govc-test-XXXXX)
export GOVMOMI_HOME="$dir"
export GOVC_PERSIST_SESSION=true

Expand Down
2 changes: 1 addition & 1 deletion govc/test/vcsim.bats
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ EOF

vcsim_stop

dir=$($mktemp --tmpdir -d govc-test-XXXXX)
dir=$($mktemp --tmpdir -d govc-test-XXXXX 2>/dev/null || $mktemp -d -t govc-test-XXXXX)
echo nobody > "$dir/username"
echo nothing > "$dir/password"

Expand Down
14 changes: 7 additions & 7 deletions simulator/folder.go
Original file line number Diff line number Diff line change
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
Loading