Revision 34876ef5
Added by Kavita Gaikwad about 5 years ago
app/models/concerns/fog_extensions/google/server.rb | ||
---|---|---|
|
||
attribute :network
|
||
attribute :associate_external_ip
|
||
|
||
# TODO: remove this, UI using it
|
||
attribute :external_ip
|
||
|
||
def persisted?
|
||
... | ... | |
def volumes_attributes=(attrs)
|
||
end
|
||
|
||
# need to fix - actual disk objects needed
|
||
# getting data =>
|
||
# return [Array<Hash>] for disks in response and doesn't contain disk_size
|
||
# Example -
|
||
# disks=[{
|
||
# :auto_delete=>true,
|
||
# :boot=>true,
|
||
... | ... | |
list_of_disks = disks
|
||
if list_of_disks[0].is_a? Hash
|
||
requires :identity, :zone
|
||
service.disks(:server => self)
|
||
service.disks.all(
|
||
:zone => self.zone_name,
|
||
:filter => construct_disk_filter(list_of_disks)
|
||
)
|
||
else
|
||
list_of_disks
|
||
end
|
||
end
|
||
|
||
def vm_ip_address
|
||
# external_ip ? public_ip_address : private_ip_address
|
||
public_ip_address || private_ip_address
|
||
end
|
||
|
||
def associate_external_ip
|
||
public_ip_address.present?
|
||
end
|
||
|
||
private
|
||
|
||
def construct_disk_filter(disks_arr)
|
||
disks_arr.map { |d| "(name = \"#{d[:source][/([^\/]+)$/]}\")" }.join(' OR ')
|
||
end
|
||
end
|
||
end
|
||
end
|
Also available in: Unified diff
Refs #26473 - refactored code & removed unwanted code in gce.rb
This commit includes
- modified help text of certificate_path on GCE compute_resource form
- show volume information for host correctly