Skip to content

Commit

Permalink
ESX Agent Manager (EAM) Client and Simulator
Browse files Browse the repository at this point in the history
This patch introduces the bindings, client, and simulator
for the ESX Agent Manager (EAM). EAM is a long-lived service on vCenter
that acts as an intermediary for provisioning agent virtual machines and
VIB modules on behalf of the user.

The following packages include:

  * ./eam           - the EAM client
  * ./eam/types     - the EAM bindings - types
  * ./eam/methods   - the EAM bindings - methods
  * ./eam/object    - the EAM helper objects, ie. more than just MoRefs
  * ./eam/simulator - the EAM simulator

For more information on how to use EAM, please see the public, EAM SDK
at http://bit.ly/eam-sdk.

This patch also updates the vC Simulator code so when containers
are deployed as VMs, goroutines are created to monitor the containers
and automatically update the runtime properties of the VM to match
the underlying state of the container, such as power state, IP addr,
etc.
  • Loading branch information
akutz committed May 17, 2021
1 parent da4f74c commit f814a9c
Show file tree
Hide file tree
Showing 34 changed files with 5,137 additions and 8 deletions.
11 changes: 11 additions & 0 deletions eam/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ESX Agent Manager (EAM)

ESX Agent Manager ([EAM](https://vdc-download.vmware.com/vmwb-repository/dcr-public/3d076a12-29a2-4d17-9269-cb8150b5a37f/8b5969e2-1a66-4425-af17-feff6d6f705d/SDK/eam/doc/index.html)) is a long-lived service on vCenter that acts as an intermediary for provisioning agent virtual machines and VIB modules on behalf of the user.

## HowTo

Please refer to [`simulator/simulator_test.go`](./simulator/simulator_test.go) for an example on how to use this package.

## Simulator

The [`simulator`](./simulator/) package provides an EAM simulator that can even simulate the lifecycle of agent VMs using containers.
42 changes: 42 additions & 0 deletions eam/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
Copyright (c) 2021 VMware, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package eam

import (
"github.com/vmware/govmomi/vim25"
"github.com/vmware/govmomi/vim25/soap"
)

const (
// Namespace is the namespace for EAM SOAP operations.
Namespace = "eam"

// Path is the path to the EAM service.
Path = "/eam/sdk"
)

// Client is a client for the ESX Agent Manager API.
type Client struct {
*soap.Client
}

// NewClient returns a new EAM client.
func NewClient(c *vim25.Client) *Client {
return &Client{
Client: c.Client.NewServiceClient(Path, Namespace),
}
}
27 changes: 27 additions & 0 deletions eam/eam.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
Copyright (c) 2021 VMware, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package eam

import (
"github.com/vmware/govmomi/eam/internal"
"github.com/vmware/govmomi/vim25/types"
)

var EsxAgentManager = types.ManagedObjectReference{
Type: internal.EsxAgentManager,
Value: internal.EsxAgentManager,
}
32 changes: 32 additions & 0 deletions eam/internal/internal.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
Copyright (c) 2021 VMware, Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package internal

const (
// EamObject is the managed object type for the EamObject base class.
EamObject = "EamObject"

// EsxAgentManager is both the managed object type and ID for the
// EsxAgentManager class.
EsxAgentManager = "EsxAgentManager"

// Agency is the managed object type for the Agency class.
Agency = "Agency"

// Agent is the managed object type for the Agency class.
Agent = "Agent"
)
Loading

0 comments on commit f814a9c

Please sign in to comment.