Class: CpOraclecloud::ComputeComponent

Inherits:
CloudComponent
  • Object
show all
Includes:
ComputeMixin
Defined in:
app/models/cp_oraclecloud/compute_component.rb

Instance Method Summary collapse

Methods included from ComputeMixin

#calculate_monthly_cost

Instance Method Details

#all_image_listsObject



14
15
16
# File 'app/models/cp_oraclecloud/compute_component.rb', line 14

def all_image_lists
  connection.image_lists.all
end

#all_ssh_keysObject



18
19
20
# File 'app/models/cp_oraclecloud/compute_component.rb', line 18

def all_ssh_keys
  connection.ssh_keys.all
end

#connectionObject



34
35
36
37
38
39
40
41
42
# File 'app/models/cp_oraclecloud/compute_component.rb', line 34

def connection 
  @connection ||= Fog::Compute.new(
    :provider => 'OracleCloud',
    :oracle_username => CpOraclecloud.username,
    :oracle_password => CpOraclecloud.password,
    :oracle_domain => CpOraclecloud.domain,
    :oracle_compute_api => CpOraclecloud.compute_api
    )
end

#instance_nameObject



30
31
32
# File 'app/models/cp_oraclecloud/compute_component.rb', line 30

def instance_name
  "name"
end

#instance_typeObject



26
27
28
# File 'app/models/cp_oraclecloud/compute_component.rb', line 26

def instance_type
  "CpOraclecloud::ComputeInstance"
end

#pretty_typeObject



22
23
24
# File 'app/models/cp_oraclecloud/compute_component.rb', line 22

def pretty_type
  'Oracle Compute Instance'
end