2
Copyright (c) 2014 VMware, Inc. All Rights Reserved.
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
8
http://www.apache.org/licenses/LICENSE-2.0
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations under the License.
20
"github.com/juju/govmomi/vim25"
21
"github.com/juju/govmomi/vim25/methods"
22
"github.com/juju/govmomi/vim25/types"
23
"golang.org/x/net/context"
26
type ProcessManager struct {
27
types.ManagedObjectReference
29
vm types.ManagedObjectReference
34
func (m ProcessManager) Reference() types.ManagedObjectReference {
35
return m.ManagedObjectReference
38
func (m ProcessManager) ListProcesses(ctx context.Context, auth types.BaseGuestAuthentication, pids []int64) ([]types.GuestProcessInfo, error) {
39
req := types.ListProcessesInGuest{
46
res, err := methods.ListProcessesInGuest(ctx, m.c, &req)
51
return res.Returnval, err
54
func (m ProcessManager) ReadEnvironmentVariable(ctx context.Context, auth types.BaseGuestAuthentication, names []string) ([]string, error) {
55
req := types.ReadEnvironmentVariableInGuest{
62
res, err := methods.ReadEnvironmentVariableInGuest(ctx, m.c, &req)
67
return res.Returnval, err
70
func (m ProcessManager) StartProgram(ctx context.Context, auth types.BaseGuestAuthentication, spec types.BaseGuestProgramSpec) (int64, error) {
71
req := types.StartProgramInGuest{
78
res, err := methods.StartProgramInGuest(ctx, m.c, &req)
83
return res.Returnval, err
86
func (m ProcessManager) TerminateProcess(ctx context.Context, auth types.BaseGuestAuthentication, pid int64) error {
87
req := types.TerminateProcessInGuest{
94
_, err := methods.TerminateProcessInGuest(ctx, m.c, &req)