Skip to content

Commit b3b8216

Browse files
authored
Merge pull request #3522 from himsngh/issue-3521
api: update eam bindings to include authentication schema with eam-vcenter build 24075398
2 parents 1058315 + 3fd16f7 commit b3b8216

File tree

3 files changed

+122
-27
lines changed

3 files changed

+122
-27
lines changed

eam/types/enum.go

+22
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,28 @@ func init() {
8484
types.Add("eam:AgencyVMPlacementPolicyVMDataAffinity", reflect.TypeOf((*AgencyVMPlacementPolicyVMDataAffinity)(nil)).Elem())
8585
}
8686

87+
type AgentConfigInfoAuthenticationScheme string
88+
89+
const (
90+
AgentConfigInfoAuthenticationSchemeNONE = AgentConfigInfoAuthenticationScheme("NONE")
91+
AgentConfigInfoAuthenticationSchemeVMWARE_SESSION_ID = AgentConfigInfoAuthenticationScheme("VMWARE_SESSION_ID")
92+
)
93+
94+
func (e AgentConfigInfoAuthenticationScheme) Values() []AgentConfigInfoAuthenticationScheme {
95+
return []AgentConfigInfoAuthenticationScheme{
96+
AgentConfigInfoAuthenticationSchemeNONE,
97+
AgentConfigInfoAuthenticationSchemeVMWARE_SESSION_ID,
98+
}
99+
}
100+
101+
func (e AgentConfigInfoAuthenticationScheme) Strings() []string {
102+
return types.EnumValuesAsStrings(e.Values())
103+
}
104+
105+
func init() {
106+
types.Add("eam:AgentConfigInfoAuthenticationScheme", reflect.TypeOf((*AgentConfigInfoAuthenticationScheme)(nil)).Elem())
107+
}
108+
87109
// Defines the type of disk provisioning for the target Agent VMs.
88110
type AgentConfigInfoOvfDiskProvisioning string
89111

eam/types/types.go

+99-26
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ type AgentConfigInfo struct {
433433
// virtual machines are installed on the hosts covered by the scope.
434434
// If `AgencyConfigInfoEx.vmPlacementPolicy` is set, the VM needs to
435435
// be agnostic to the different host versions inside the cluster.
436-
OvfPackageUrl string `xml:"ovfPackageUrl,omitempty" json:"ovfPackageUrl,omitempty"`
436+
OvfPackageUrl string `xml:"ovfPackageUrl,omitempty" json:"ovfPackageUrl,omitempty"`
437+
AuthenticationScheme string `xml:"authenticationScheme,omitempty" json:"authenticationScheme,omitempty"`
437438
// Specifies an SSL trust policy to be use for verification of the
438439
// server that hosts the `AgentConfigInfo.ovfPackageUrl`.
439440
//
@@ -883,14 +884,6 @@ func init() {
883884
types.Add("eam:ArrayOfAgentVibMatchingRule", reflect.TypeOf((*ArrayOfAgentVibMatchingRule)(nil)).Elem())
884885
}
885886

886-
type ArrayOfHooksHookInfo struct {
887-
HooksHookInfo []HooksHookInfo `xml:"HooksHookInfo,omitempty" json:"_value"`
888-
}
889-
890-
func init() {
891-
types.Add("eam:ArrayOfHooksHookInfo", reflect.TypeOf((*ArrayOfHooksHookInfo)(nil)).Elem())
892-
}
893-
894887
// A boxed array of `Issue`. To be used in `Any` placeholders.
895888
//
896889
// This structure may be used only with operations rendered under `/eam`.
@@ -935,6 +928,17 @@ func init() {
935928
types.Add("eam:ArrayOfSolutionsHookConfig", reflect.TypeOf((*ArrayOfSolutionsHookConfig)(nil)).Elem())
936929
}
937930

931+
// A boxed array of `SolutionsHookInfo`. To be used in `Any` placeholders.
932+
//
933+
// This structure may be used only with operations rendered under `/eam`.
934+
type ArrayOfSolutionsHookInfo struct {
935+
SolutionsHookInfo []SolutionsHookInfo `xml:"SolutionsHookInfo,omitempty" json:"_value"`
936+
}
937+
938+
func init() {
939+
types.Add("eam:ArrayOfSolutionsHookInfo", reflect.TypeOf((*ArrayOfSolutionsHookInfo)(nil)).Elem())
940+
}
941+
938942
// A boxed array of `SolutionsHostComplianceResult`. To be used in `Any` placeholders.
939943
//
940944
// This structure may be used only with operations rendered under `/eam`.
@@ -1320,6 +1324,22 @@ func init() {
13201324
types.Add("eam:ClusterAgentOvfInvalidProperty", reflect.TypeOf((*ClusterAgentOvfInvalidProperty)(nil)).Elem())
13211325
}
13221326

1327+
type ClusterAgentVmHookFailed struct {
1328+
ClusterAgentVmIssue
1329+
}
1330+
1331+
func init() {
1332+
types.Add("eam:ClusterAgentVmHookFailed", reflect.TypeOf((*ClusterAgentVmHookFailed)(nil)).Elem())
1333+
}
1334+
1335+
type ClusterAgentVmHookTimedout struct {
1336+
ClusterAgentVmIssue
1337+
}
1338+
1339+
func init() {
1340+
types.Add("eam:ClusterAgentVmHookTimedout", reflect.TypeOf((*ClusterAgentVmHookTimedout)(nil)).Elem())
1341+
}
1342+
13231343
type ClusterAgentVmInaccessible struct {
13241344
ClusterAgentVmIssue
13251345
}
@@ -1415,6 +1435,14 @@ func init() {
14151435
types.Add("eam:ClusterAgentVmPoweredOn", reflect.TypeOf((*ClusterAgentVmPoweredOn)(nil)).Elem())
14161436
}
14171437

1438+
type ClusterAgentVmProtected struct {
1439+
ClusterAgentVmIssue
1440+
}
1441+
1442+
func init() {
1443+
types.Add("eam:ClusterAgentVmProtected", reflect.TypeOf((*ClusterAgentVmProtected)(nil)).Elem())
1444+
}
1445+
14181446
// A cluster agent Virtual Machine is expected to be powered on, but the agent
14191447
// Virtual Machine is suspended.
14201448
//
@@ -1760,19 +1788,6 @@ type GetMaintenanceModePolicyResponse struct {
17601788
Returnval string `xml:"returnval" json:"returnval"`
17611789
}
17621790

1763-
type HooksHookInfo struct {
1764-
types.DynamicData
1765-
1766-
Vm types.ManagedObjectReference `xml:"vm" json:"vm"`
1767-
Solution string `xml:"solution" json:"solution"`
1768-
HookType string `xml:"hookType" json:"hookType"`
1769-
RaisedAt time.Time `xml:"raisedAt" json:"raisedAt"`
1770-
}
1771-
1772-
func init() {
1773-
types.Add("eam:HooksHookInfo", reflect.TypeOf((*HooksHookInfo)(nil)).Elem())
1774-
}
1775-
17761791
// Limits the hooks reported to the user.
17771792
//
17781793
// This structure may be used only with operations rendered under `/eam`.
@@ -2987,7 +3002,8 @@ type SolutionsClusterBoundSolutionConfig struct {
29873002
// contain duplicate elements.
29883003
//
29893004
// Refers instances of `Datastore`.
2990-
Datastores []types.ManagedObjectReference `xml:"datastores" json:"datastores"`
3005+
Datastores []types.ManagedObjectReference `xml:"datastores,omitempty" json:"datastores,omitempty"`
3006+
Devices *types.VirtualMachineConfigSpec `xml:"devices,omitempty" json:"devices,omitempty"`
29913007
}
29923008

29933009
func init() {
@@ -3113,12 +3129,41 @@ type SolutionsHookConfig struct {
31133129
Type string `xml:"type" json:"type"`
31143130
// Type of acknoledgement of the configured hook.
31153131
Acknowledgement BaseSolutionsHookAcknowledgeConfig `xml:"acknowledgement,typeattr" json:"acknowledgement"`
3132+
// The maximum time in seconds to wait for a hook to be processed.
3133+
//
3134+
// An
3135+
// issue is raised if the time elapsed and the hook is still not
3136+
// processed.
3137+
// If omitted - defaults to 10 hours.
3138+
Timeout int64 `xml:"timeout,omitempty" json:"timeout,omitempty"`
31163139
}
31173140

31183141
func init() {
31193142
types.Add("eam:SolutionsHookConfig", reflect.TypeOf((*SolutionsHookConfig)(nil)).Elem())
31203143
}
31213144

3145+
// Contains information for a raised hook.
3146+
//
3147+
// This structure may be used only with operations rendered under `/eam`.
3148+
type SolutionsHookInfo struct {
3149+
types.DynamicData
3150+
3151+
// Virtual Machine, the hook was raised for.
3152+
//
3153+
// Refers instance of `VirtualMachine`.
3154+
Vm types.ManagedObjectReference `xml:"vm" json:"vm"`
3155+
// Solution the Virtual Machine belongs to.
3156+
Solution string `xml:"solution" json:"solution"`
3157+
// Configuration of the hook.
3158+
Config SolutionsHookConfig `xml:"config" json:"config"`
3159+
// Time the hook was raised.
3160+
RaisedAt time.Time `xml:"raisedAt" json:"raisedAt"`
3161+
}
3162+
3163+
func init() {
3164+
types.Add("eam:SolutionsHookInfo", reflect.TypeOf((*SolutionsHookInfo)(nil)).Elem())
3165+
}
3166+
31223167
// Specifies host-bound solution configuration.
31233168
//
31243169
// This structure may be used only with operations rendered under `/eam`.
@@ -3248,7 +3293,7 @@ type SolutionsSolutionComplianceResult struct {
32483293
// Refers instance of `VirtualMachine`.
32493294
UpgradingVm *types.ManagedObjectReference `xml:"upgradingVm,omitempty" json:"upgradingVm,omitempty"`
32503295
// Hook, ESX Agent Manager is awaiting to be processed for this solution.
3251-
Hook *HooksHookInfo `xml:"hook,omitempty" json:"hook,omitempty"`
3296+
Hook *SolutionsHookInfo `xml:"hook,omitempty" json:"hook,omitempty"`
32523297
// Issues, ESX Agent Manager has encountered while attempting to acheive
32533298
// the solution's requested desired state.
32543299
Issues []BaseIssue `xml:"issues,omitempty,typeattr" json:"issues,omitempty"`
@@ -3269,10 +3314,14 @@ type SolutionsSolutionConfig struct {
32693314

32703315
// Solution, this configuration belongs to.
32713316
Solution string `xml:"solution" json:"solution"`
3272-
Name string `xml:"name" json:"name"`
3273-
Version string `xml:"version" json:"version"`
3317+
// Display name of the solution.
3318+
DisplayName string `xml:"displayName" json:"displayName"`
3319+
// Display version of the solution.
3320+
DisplayVersion string `xml:"displayVersion" json:"displayVersion"`
32743321
// Source of the system Virtual Machine files.
32753322
VmSource BaseSolutionsVMSource `xml:"vmSource,typeattr" json:"vmSource"`
3323+
// VM name prefix.
3324+
PrefixVmName string `xml:"prefixVmName" json:"prefixVmName"`
32763325
// If set to `True` - will insert an UUID in the system Virtual
32773326
// Machines' names created for the solution, otherwise - no additional
32783327
// UUID will be inserted in the system Virtual Machines' names.
@@ -3873,6 +3922,22 @@ func init() {
38733922
types.Add("eam:VmDeployed", reflect.TypeOf((*VmDeployed)(nil)).Elem())
38743923
}
38753924

3925+
type VmHookFailed struct {
3926+
VmIssue
3927+
}
3928+
3929+
func init() {
3930+
types.Add("eam:VmHookFailed", reflect.TypeOf((*VmHookFailed)(nil)).Elem())
3931+
}
3932+
3933+
type VmHookTimedout struct {
3934+
VmIssue
3935+
}
3936+
3937+
func init() {
3938+
types.Add("eam:VmHookTimedout", reflect.TypeOf((*VmHookTimedout)(nil)).Elem())
3939+
}
3940+
38763941
type VmInaccessible struct {
38773942
VmIssue
38783943
}
@@ -3980,6 +4045,14 @@ func init() {
39804045
types.Add("eam:VmPoweredOn", reflect.TypeOf((*VmPoweredOn)(nil)).Elem())
39814046
}
39824047

4048+
type VmProtected struct {
4049+
VmIssue
4050+
}
4051+
4052+
func init() {
4053+
types.Add("eam:VmProtected", reflect.TypeOf((*VmProtected)(nil)).Elem())
4054+
}
4055+
39834056
// An agent virtual machine is expected to be deployed on a host, but the agent
39844057
// virtual machine cannot be deployed because the host is in Maintenance Mode.
39854058
//

gen/gen.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ generate "../vslm" "vslm"
9999
generate "../sms" "sms"
100100

101101
# ./sdk/ contains the files eam-messagetypes.xsd and eam-types.xsd from
102-
# eam-wsdl.zip, from eam-vcenter build 23699138.
102+
# eam-wsdl.zip, from eam-vcenter build 24075398.
103103
#
104104
# Please note the EAM files are also available at the following, public URL --
105105
# http://bit.ly/eam-sdk, therefore the WSDL resource for EAM are in fact

0 commit comments

Comments
 (0)