Adding vSphere Volume support for vSphere Cloud Provider
This commit is contained in:
24
vendor/github.com/vmware/govmomi/vim25/mo/entity.go
generated
vendored
Normal file
24
vendor/github.com/vmware/govmomi/vim25/mo/entity.go
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
Copyright (c) 2016 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 mo
|
||||
|
||||
// Entity is the interface that is implemented by all managed objects
|
||||
// that extend ManagedEntity.
|
||||
type Entity interface {
|
||||
Reference
|
||||
Entity() *ManagedEntity
|
||||
}
|
||||
36
vendor/github.com/vmware/govmomi/vim25/mo/mo.go
generated
vendored
36
vendor/github.com/vmware/govmomi/vim25/mo/mo.go
generated
vendored
@@ -130,6 +130,10 @@ type ComputeResource struct {
|
||||
ConfigurationEx types.BaseComputeResourceConfigInfo `mo:"configurationEx"`
|
||||
}
|
||||
|
||||
func (m *ComputeResource) Entity() *ManagedEntity {
|
||||
return &m.ManagedEntity
|
||||
}
|
||||
|
||||
func init() {
|
||||
t["ComputeResource"] = reflect.TypeOf((*ComputeResource)(nil)).Elem()
|
||||
}
|
||||
@@ -187,6 +191,10 @@ type Datacenter struct {
|
||||
Configuration types.DatacenterConfigInfo `mo:"configuration"`
|
||||
}
|
||||
|
||||
func (m *Datacenter) Entity() *ManagedEntity {
|
||||
return &m.ManagedEntity
|
||||
}
|
||||
|
||||
func init() {
|
||||
t["Datacenter"] = reflect.TypeOf((*Datacenter)(nil)).Elem()
|
||||
}
|
||||
@@ -203,6 +211,10 @@ type Datastore struct {
|
||||
IormConfiguration *types.StorageIORMInfo `mo:"iormConfiguration"`
|
||||
}
|
||||
|
||||
func (m *Datastore) Entity() *ManagedEntity {
|
||||
return &m.ManagedEntity
|
||||
}
|
||||
|
||||
func init() {
|
||||
t["Datastore"] = reflect.TypeOf((*Datastore)(nil)).Elem()
|
||||
}
|
||||
@@ -255,6 +267,10 @@ type DistributedVirtualSwitch struct {
|
||||
Runtime *types.DVSRuntimeInfo `mo:"runtime"`
|
||||
}
|
||||
|
||||
func (m *DistributedVirtualSwitch) Entity() *ManagedEntity {
|
||||
return &m.ManagedEntity
|
||||
}
|
||||
|
||||
func init() {
|
||||
t["DistributedVirtualSwitch"] = reflect.TypeOf((*DistributedVirtualSwitch)(nil)).Elem()
|
||||
}
|
||||
@@ -359,6 +375,10 @@ type Folder struct {
|
||||
ChildEntity []types.ManagedObjectReference `mo:"childEntity"`
|
||||
}
|
||||
|
||||
func (m *Folder) Entity() *ManagedEntity {
|
||||
return &m.ManagedEntity
|
||||
}
|
||||
|
||||
func init() {
|
||||
t["Folder"] = reflect.TypeOf((*Folder)(nil)).Elem()
|
||||
}
|
||||
@@ -878,6 +898,10 @@ type HostSystem struct {
|
||||
SystemResources *types.HostSystemResourceInfo `mo:"systemResources"`
|
||||
}
|
||||
|
||||
func (m *HostSystem) Entity() *ManagedEntity {
|
||||
return &m.ManagedEntity
|
||||
}
|
||||
|
||||
func init() {
|
||||
t["HostSystem"] = reflect.TypeOf((*HostSystem)(nil)).Elem()
|
||||
}
|
||||
@@ -1117,6 +1141,10 @@ type Network struct {
|
||||
Vm []types.ManagedObjectReference `mo:"vm"`
|
||||
}
|
||||
|
||||
func (m *Network) Entity() *ManagedEntity {
|
||||
return &m.ManagedEntity
|
||||
}
|
||||
|
||||
func init() {
|
||||
t["Network"] = reflect.TypeOf((*Network)(nil)).Elem()
|
||||
}
|
||||
@@ -1286,6 +1314,10 @@ type ResourcePool struct {
|
||||
ChildConfiguration []types.ResourceConfigSpec `mo:"childConfiguration"`
|
||||
}
|
||||
|
||||
func (m *ResourcePool) Entity() *ManagedEntity {
|
||||
return &m.ManagedEntity
|
||||
}
|
||||
|
||||
func init() {
|
||||
t["ResourcePool"] = reflect.TypeOf((*ResourcePool)(nil)).Elem()
|
||||
}
|
||||
@@ -1551,6 +1583,10 @@ type VirtualMachine struct {
|
||||
GuestHeartbeatStatus types.ManagedEntityStatus `mo:"guestHeartbeatStatus"`
|
||||
}
|
||||
|
||||
func (m *VirtualMachine) Entity() *ManagedEntity {
|
||||
return &m.ManagedEntity
|
||||
}
|
||||
|
||||
func init() {
|
||||
t["VirtualMachine"] = reflect.TypeOf((*VirtualMachine)(nil)).Elem()
|
||||
}
|
||||
|
||||
10
vendor/github.com/vmware/govmomi/vim25/mo/type_info.go
generated
vendored
10
vendor/github.com/vmware/govmomi/vim25/mo/type_info.go
generated
vendored
@@ -189,12 +189,20 @@ func assignValue(val reflect.Value, fi []int, pv reflect.Value) {
|
||||
npv := reflect.New(pt)
|
||||
npv.Elem().Set(pv)
|
||||
pv = npv
|
||||
pt = pv.Type()
|
||||
} else {
|
||||
panic(fmt.Sprintf("type %s doesn't implement %s", pt.Name(), rt.Name()))
|
||||
}
|
||||
}
|
||||
|
||||
rv.Set(pv)
|
||||
if pt.AssignableTo(rt) {
|
||||
rv.Set(pv)
|
||||
} else if rt.ConvertibleTo(pt) {
|
||||
rv.Set(pv.Convert(rt))
|
||||
} else {
|
||||
panic(fmt.Sprintf("cannot assign %s (%s) to %s (%s)", rt.Name(), rt.Kind(), pt.Name(), pt.Kind()))
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user