Class: HammerCLIForeman::ComputeResources::GCE

Inherits:
Base
  • Object
show all
Defined in:
lib/hammer_cli_foreman/compute_resource/gce.rb

Instance Method Summary collapse

Methods inherited from Base

#host_attributes, #interface_attributes

Instance Method Details

#compute_attributesObject



8
9
10
# File 'lib/hammer_cli_foreman/compute_resource/gce.rb', line 8

def compute_attributes
  %w[machine_type network associate_external_ip]
end

#interfaces_attrs_nameObject



12
13
14
# File 'lib/hammer_cli_foreman/compute_resource/gce.rb', line 12

def interfaces_attrs_name
  'network_interfaces_nics_attributes'
end

#mandatory_resource_optionsObject



40
41
42
# File 'lib/hammer_cli_foreman/compute_resource/gce.rb', line 40

def mandatory_resource_options
  super + %I{project key_path zone}
end

#nameObject



4
5
6
# File 'lib/hammer_cli_foreman/compute_resource/gce.rb', line 4

def name
  'GCE'
end

#provider_specific_fieldsObject



22
23
24
25
26
27
28
29
# File 'lib/hammer_cli_foreman/compute_resource/gce.rb', line 22

def provider_specific_fields
  [
    Fields::Field.new(:label => _('Project'), :path => [:project]),
    Fields::Field.new(:label => _('Email'), :path => [:email]),
    Fields::Field.new(:label => _('Key Path'), :path => [:key_path]),
    Fields::Field.new(:label => _('Zone'), :path => [:zone])
  ]
end

#provider_vm_specific_fieldsObject



31
32
33
34
35
36
37
38
# File 'lib/hammer_cli_foreman/compute_resource/gce.rb', line 31

def provider_vm_specific_fields
  [
    Fields::Field.new(:label => _('Machine Type'), :path => [:machine_type]),
    Fields::Field.new(:label => _('Status'), :path => [:status]),
    Fields::Field.new(:label => _('Description'), :path => [:description]),
    Fields::Field.new(:label => _('Zone'), :path => [:zone])
  ]
end

#volume_attributesObject



16
17
18
19
20
# File 'lib/hammer_cli_foreman/compute_resource/gce.rb', line 16

def volume_attributes
  [
    ['size_gb', _('Volume size in GB, integer value')]
  ]
end