-
Notifications
You must be signed in to change notification settings - Fork 914
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api: move cli/host/esxcli.Command to cli/esx package
The cli/esx package is free of govc dependencies. Cleaner to use from the simulator package and externally. BREAKING: Package "github.com/vmware/govmomi/govc/host/esxcli" is now "github.com/vmware/govmomi/cli/esx" A 'context.Context' param has also been added to the package's methods. See cli/esx/example_test.go for usage. Signed-off-by: Doug MacEachern <[email protected]>
- Loading branch information
Showing
18 changed files
with
325 additions
and
252 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/* | ||
Copyright (c) 2024-2024 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 esx_test | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/vmware/govmomi/cli/esx" | ||
"github.com/vmware/govmomi/find" | ||
"github.com/vmware/govmomi/simulator" | ||
"github.com/vmware/govmomi/vim25" | ||
) | ||
|
||
func ExampleExecutor_Run() { | ||
simulator.Run(func(ctx context.Context, c *vim25.Client) error { | ||
host, err := find.NewFinder(c).HostSystem(ctx, "DC0_H0") | ||
if err != nil { | ||
return err | ||
} | ||
|
||
x, err := esx.NewExecutor(ctx, c, host) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
res, err := x.Run(ctx, []string{"software", "vib", "list"}) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
for _, vib := range res.Values { | ||
fmt.Println(vib.Value("Name")) | ||
} | ||
|
||
return nil | ||
}) | ||
// Output: | ||
// esx-ui | ||
// intelgpio | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.