Class: Fog::Compute::OracleCloud::Instance
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::OracleCloud::Instance
- Defined in:
- lib/fog/oraclecloud/models/compute/instance.rb
Instance Method Summary collapse
Instance Method Details
#clean_name ⇒ Object
46 47 48 |
# File 'lib/fog/oraclecloud/models/compute/instance.rb', line 46 def clean_name name.sub %r{\/.*\/}, '' end |
#create ⇒ Object
55 56 57 58 59 60 |
# File 'lib/fog/oraclecloud/models/compute/instance.rb', line 55 def create requires :name, :shape, :imagelist, :label, :sshkeys data = service.create_instance(name, shape, imagelist, label, sshkeys) merge_attributes(data.body['instances'][0]) end |
#destroy ⇒ Object
62 63 64 65 |
# File 'lib/fog/oraclecloud/models/compute/instance.rb', line 62 def destroy requires :name service.delete_instance(name) end |
#ready? ⇒ Boolean
42 43 44 |
# File 'lib/fog/oraclecloud/models/compute/instance.rb', line 42 def ready? state == 'running' end |
#save ⇒ Object
50 51 52 53 |
# File 'lib/fog/oraclecloud/models/compute/instance.rb', line 50 def save #identity ? update : create create end |