fog / fog-vsphere

Fog for vSphere
MIT License
36 stars 63 forks source link

Expose _ref attribute of Compute::Network #265

Closed pendor closed 3 years ago

pendor commented 4 years ago

The get_network and get_raw_network functions in Fog::Vsphere::Compute::Real lib/fog/vsphere/requests/compute/get_network.rb accept either a Name or a _ref attribute of a network object. The Fog::Vsphere::Compute::Network object in lib/fog/vsphere/models/compute/network.rb doesn't currently expose the _ref attribute as a publicly accessible value, even though the data is present in the underlying ActiveRecord from the API call to VSphere.

The _ref attribute should be exposed so that it can be used to later call get_network with a globally unique value. Name may not be unique in some environments. Additionally, at least one client of fog-vsphere (Foreman) currently incorrectly uses the visible id attribute in place of the _ref attribute when calling get_raw_network. This works in many but not all instances as id is often but not always the same value as _ref, depending on how VSphere objects have been edited over time.

ezr-ondrej commented 3 years ago

Thanks a lot @pendor! This has been released as part of v3.5.0 release.