Class: OracleCloud::Instance
- Inherits:
-
Asset
- Object
- Asset
- OracleCloud::Instance
show all
- Defined in:
- lib/oraclecloud/instance.rb
Instance Attribute Summary
Attributes inherited from Asset
#asset_data, #asset_type, #client, #container, #path
Instance Method Summary
collapse
Methods inherited from Asset
#fetch, #initialize, #name_with_container, #strip_identity_domain, #validate!
Instance Method Details
#delete ⇒ Object
72
73
74
75
76
77
|
# File 'lib/oraclecloud/instance.rb', line 72
def delete
raise 'Unable to delete instance, instance is part of orchestration ' \
"#{orchestration} - delete the orchestration instead" unless orchestration.nil?
client.asset_delete(asset_type, id)
end
|
#full_name ⇒ Object
28
29
30
|
# File 'lib/oraclecloud/instance.rb', line 28
def full_name
asset_data['name']
end
|
#hostname ⇒ Object
44
45
46
|
# File 'lib/oraclecloud/instance.rb', line 44
def hostname
asset_data['hostname']
end
|
#id ⇒ Object
24
25
26
|
# File 'lib/oraclecloud/instance.rb', line 24
def id
strip_identity_domain(asset_data['name'])
end
|
#image ⇒ Object
36
37
38
|
# File 'lib/oraclecloud/instance.rb', line 36
def image
asset_data['imagelist']
end
|
#ip_address ⇒ Object
32
33
34
|
# File 'lib/oraclecloud/instance.rb', line 32
def ip_address
asset_data['ip']
end
|
#label ⇒ Object
48
49
50
|
# File 'lib/oraclecloud/instance.rb', line 48
def label
asset_data['label']
end
|
#local_init ⇒ Object
20
21
22
|
# File 'lib/oraclecloud/instance.rb', line 20
def local_init
@asset_type = 'instance'
end
|
#orchestration ⇒ Object
65
66
67
68
69
70
|
# File 'lib/oraclecloud/instance.rb', line 65
def orchestration
orchestration = asset_data['attributes']['nimbula_orchestration']
return if orchestration.nil?
strip_identity_domain(orchestration)
end
|
#public_ip_addresses ⇒ Object
61
62
63
|
# File 'lib/oraclecloud/instance.rb', line 61
def public_ip_addresses
client.ip_associations.find_by_vcable(vcable_id).map(&:ip_address)
end
|
#shape ⇒ Object
40
41
42
|
# File 'lib/oraclecloud/instance.rb', line 40
def shape
asset_data['shape']
end
|
#state ⇒ Object
Also known as:
status
52
53
54
|
# File 'lib/oraclecloud/instance.rb', line 52
def state
asset_data['state']
end
|
#vcable_id ⇒ Object
57
58
59
|
# File 'lib/oraclecloud/instance.rb', line 57
def vcable_id
asset_data['vcable_id']
end
|