Skip to content

Commit

Permalink
Merge pull request #3522 from himsngh/issue-3521
Browse files Browse the repository at this point in the history
api: update eam bindings to include authentication schema with eam-vcenter build 24075398
  • Loading branch information
dougm authored Aug 16, 2024
2 parents 1058315 + 3fd16f7 commit b3b8216
Show file tree
Hide file tree
Showing 3 changed files with 122 additions and 27 deletions.
22 changes: 22 additions & 0 deletions eam/types/enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,28 @@ func init() {
types.Add("eam:AgencyVMPlacementPolicyVMDataAffinity", reflect.TypeOf((*AgencyVMPlacementPolicyVMDataAffinity)(nil)).Elem())
}

type AgentConfigInfoAuthenticationScheme string

const (
AgentConfigInfoAuthenticationSchemeNONE = AgentConfigInfoAuthenticationScheme("NONE")
AgentConfigInfoAuthenticationSchemeVMWARE_SESSION_ID = AgentConfigInfoAuthenticationScheme("VMWARE_SESSION_ID")
)

func (e AgentConfigInfoAuthenticationScheme) Values() []AgentConfigInfoAuthenticationScheme {
return []AgentConfigInfoAuthenticationScheme{
AgentConfigInfoAuthenticationSchemeNONE,
AgentConfigInfoAuthenticationSchemeVMWARE_SESSION_ID,
}
}

func (e AgentConfigInfoAuthenticationScheme) Strings() []string {
return types.EnumValuesAsStrings(e.Values())
}

func init() {
types.Add("eam:AgentConfigInfoAuthenticationScheme", reflect.TypeOf((*AgentConfigInfoAuthenticationScheme)(nil)).Elem())
}

// Defines the type of disk provisioning for the target Agent VMs.
type AgentConfigInfoOvfDiskProvisioning string

Expand Down
125 changes: 99 additions & 26 deletions eam/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ type AgentConfigInfo struct {
// virtual machines are installed on the hosts covered by the scope.
// If `AgencyConfigInfoEx.vmPlacementPolicy` is set, the VM needs to
// be agnostic to the different host versions inside the cluster.
OvfPackageUrl string `xml:"ovfPackageUrl,omitempty" json:"ovfPackageUrl,omitempty"`
OvfPackageUrl string `xml:"ovfPackageUrl,omitempty" json:"ovfPackageUrl,omitempty"`
AuthenticationScheme string `xml:"authenticationScheme,omitempty" json:"authenticationScheme,omitempty"`
// Specifies an SSL trust policy to be use for verification of the
// server that hosts the `AgentConfigInfo.ovfPackageUrl`.
//
Expand Down Expand Up @@ -883,14 +884,6 @@ func init() {
types.Add("eam:ArrayOfAgentVibMatchingRule", reflect.TypeOf((*ArrayOfAgentVibMatchingRule)(nil)).Elem())
}

type ArrayOfHooksHookInfo struct {
HooksHookInfo []HooksHookInfo `xml:"HooksHookInfo,omitempty" json:"_value"`
}

func init() {
types.Add("eam:ArrayOfHooksHookInfo", reflect.TypeOf((*ArrayOfHooksHookInfo)(nil)).Elem())
}

// A boxed array of `Issue`. To be used in `Any` placeholders.
//
// This structure may be used only with operations rendered under `/eam`.
Expand Down Expand Up @@ -935,6 +928,17 @@ func init() {
types.Add("eam:ArrayOfSolutionsHookConfig", reflect.TypeOf((*ArrayOfSolutionsHookConfig)(nil)).Elem())
}

// A boxed array of `SolutionsHookInfo`. To be used in `Any` placeholders.
//
// This structure may be used only with operations rendered under `/eam`.
type ArrayOfSolutionsHookInfo struct {
SolutionsHookInfo []SolutionsHookInfo `xml:"SolutionsHookInfo,omitempty" json:"_value"`
}

func init() {
types.Add("eam:ArrayOfSolutionsHookInfo", reflect.TypeOf((*ArrayOfSolutionsHookInfo)(nil)).Elem())
}

// A boxed array of `SolutionsHostComplianceResult`. To be used in `Any` placeholders.
//
// This structure may be used only with operations rendered under `/eam`.
Expand Down Expand Up @@ -1320,6 +1324,22 @@ func init() {
types.Add("eam:ClusterAgentOvfInvalidProperty", reflect.TypeOf((*ClusterAgentOvfInvalidProperty)(nil)).Elem())
}

type ClusterAgentVmHookFailed struct {
ClusterAgentVmIssue
}

func init() {
types.Add("eam:ClusterAgentVmHookFailed", reflect.TypeOf((*ClusterAgentVmHookFailed)(nil)).Elem())
}

type ClusterAgentVmHookTimedout struct {
ClusterAgentVmIssue
}

func init() {
types.Add("eam:ClusterAgentVmHookTimedout", reflect.TypeOf((*ClusterAgentVmHookTimedout)(nil)).Elem())
}

type ClusterAgentVmInaccessible struct {
ClusterAgentVmIssue
}
Expand Down Expand Up @@ -1415,6 +1435,14 @@ func init() {
types.Add("eam:ClusterAgentVmPoweredOn", reflect.TypeOf((*ClusterAgentVmPoweredOn)(nil)).Elem())
}

type ClusterAgentVmProtected struct {
ClusterAgentVmIssue
}

func init() {
types.Add("eam:ClusterAgentVmProtected", reflect.TypeOf((*ClusterAgentVmProtected)(nil)).Elem())
}

// A cluster agent Virtual Machine is expected to be powered on, but the agent
// Virtual Machine is suspended.
//
Expand Down Expand Up @@ -1760,19 +1788,6 @@ type GetMaintenanceModePolicyResponse struct {
Returnval string `xml:"returnval" json:"returnval"`
}

type HooksHookInfo struct {
types.DynamicData

Vm types.ManagedObjectReference `xml:"vm" json:"vm"`
Solution string `xml:"solution" json:"solution"`
HookType string `xml:"hookType" json:"hookType"`
RaisedAt time.Time `xml:"raisedAt" json:"raisedAt"`
}

func init() {
types.Add("eam:HooksHookInfo", reflect.TypeOf((*HooksHookInfo)(nil)).Elem())
}

// Limits the hooks reported to the user.
//
// This structure may be used only with operations rendered under `/eam`.
Expand Down Expand Up @@ -2987,7 +3002,8 @@ type SolutionsClusterBoundSolutionConfig struct {
// contain duplicate elements.
//
// Refers instances of `Datastore`.
Datastores []types.ManagedObjectReference `xml:"datastores" json:"datastores"`
Datastores []types.ManagedObjectReference `xml:"datastores,omitempty" json:"datastores,omitempty"`
Devices *types.VirtualMachineConfigSpec `xml:"devices,omitempty" json:"devices,omitempty"`
}

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

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

// Contains information for a raised hook.
//
// This structure may be used only with operations rendered under `/eam`.
type SolutionsHookInfo struct {
types.DynamicData

// Virtual Machine, the hook was raised for.
//
// Refers instance of `VirtualMachine`.
Vm types.ManagedObjectReference `xml:"vm" json:"vm"`
// Solution the Virtual Machine belongs to.
Solution string `xml:"solution" json:"solution"`
// Configuration of the hook.
Config SolutionsHookConfig `xml:"config" json:"config"`
// Time the hook was raised.
RaisedAt time.Time `xml:"raisedAt" json:"raisedAt"`
}

func init() {
types.Add("eam:SolutionsHookInfo", reflect.TypeOf((*SolutionsHookInfo)(nil)).Elem())
}

// Specifies host-bound solution configuration.
//
// This structure may be used only with operations rendered under `/eam`.
Expand Down Expand Up @@ -3248,7 +3293,7 @@ type SolutionsSolutionComplianceResult struct {
// Refers instance of `VirtualMachine`.
UpgradingVm *types.ManagedObjectReference `xml:"upgradingVm,omitempty" json:"upgradingVm,omitempty"`
// Hook, ESX Agent Manager is awaiting to be processed for this solution.
Hook *HooksHookInfo `xml:"hook,omitempty" json:"hook,omitempty"`
Hook *SolutionsHookInfo `xml:"hook,omitempty" json:"hook,omitempty"`
// Issues, ESX Agent Manager has encountered while attempting to acheive
// the solution's requested desired state.
Issues []BaseIssue `xml:"issues,omitempty,typeattr" json:"issues,omitempty"`
Expand All @@ -3269,10 +3314,14 @@ type SolutionsSolutionConfig struct {

// Solution, this configuration belongs to.
Solution string `xml:"solution" json:"solution"`
Name string `xml:"name" json:"name"`
Version string `xml:"version" json:"version"`
// Display name of the solution.
DisplayName string `xml:"displayName" json:"displayName"`
// Display version of the solution.
DisplayVersion string `xml:"displayVersion" json:"displayVersion"`
// Source of the system Virtual Machine files.
VmSource BaseSolutionsVMSource `xml:"vmSource,typeattr" json:"vmSource"`
// VM name prefix.
PrefixVmName string `xml:"prefixVmName" json:"prefixVmName"`
// If set to `True` - will insert an UUID in the system Virtual
// Machines' names created for the solution, otherwise - no additional
// UUID will be inserted in the system Virtual Machines' names.
Expand Down Expand Up @@ -3873,6 +3922,22 @@ func init() {
types.Add("eam:VmDeployed", reflect.TypeOf((*VmDeployed)(nil)).Elem())
}

type VmHookFailed struct {
VmIssue
}

func init() {
types.Add("eam:VmHookFailed", reflect.TypeOf((*VmHookFailed)(nil)).Elem())
}

type VmHookTimedout struct {
VmIssue
}

func init() {
types.Add("eam:VmHookTimedout", reflect.TypeOf((*VmHookTimedout)(nil)).Elem())
}

type VmInaccessible struct {
VmIssue
}
Expand Down Expand Up @@ -3980,6 +4045,14 @@ func init() {
types.Add("eam:VmPoweredOn", reflect.TypeOf((*VmPoweredOn)(nil)).Elem())
}

type VmProtected struct {
VmIssue
}

func init() {
types.Add("eam:VmProtected", reflect.TypeOf((*VmProtected)(nil)).Elem())
}

// An agent virtual machine is expected to be deployed on a host, but the agent
// virtual machine cannot be deployed because the host is in Maintenance Mode.
//
Expand Down
2 changes: 1 addition & 1 deletion gen/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ 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 23699138.
# eam-wsdl.zip, from eam-vcenter build 24075398.
#
# 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

0 comments on commit b3b8216

Please sign in to comment.