Class: Fog::OracleCloud::Java::Instance
- Inherits:
-
Model
- Object
- Model
- Fog::OracleCloud::Java::Instance
- Defined in:
- lib/fog/oraclecloud/models/java/instance.rb
Instance Method Summary collapse
- #destroy ⇒ Object
-
#initialize(attributes = {}) ⇒ Instance
constructor
A new instance of Instance.
- #ready? ⇒ Boolean
- #save ⇒ Object
- #servers ⇒ Object
- #stopped? ⇒ Boolean
- #stopping? ⇒ Boolean
Constructor Details
#initialize(attributes = {}) ⇒ Instance
Returns a new instance of Instance.
67 68 69 70 71 72 73 |
# File 'lib/fog/oraclecloud/models/java/instance.rb', line 67 def initialize(attributes={}) level ||= 'PAAS' subscription_type ||= 'HOURLY' edition ||= 'EE' super end |
Instance Method Details
#destroy ⇒ Object
96 97 98 99 |
# File 'lib/fog/oraclecloud/models/java/instance.rb', line 96 def destroy requires :service_name, :dba_name, :dba_password service.delete_instance(service_name, dba_name, dba_password, :force_delete => force_delete).body end |
#ready? ⇒ Boolean
80 81 82 |
# File 'lib/fog/oraclecloud/models/java/instance.rb', line 80 def ready? status == "Running" end |
#save ⇒ Object
75 76 77 78 |
# File 'lib/fog/oraclecloud/models/java/instance.rb', line 75 def save #identity ? update : create create end |
#servers ⇒ Object
92 93 94 |
# File 'lib/fog/oraclecloud/models/java/instance.rb', line 92 def servers service.servers.all(service_name) end |
#stopped? ⇒ Boolean
88 89 90 |
# File 'lib/fog/oraclecloud/models/java/instance.rb', line 88 def stopped? status == 'Stopped' end |
#stopping? ⇒ Boolean
84 85 86 |
# File 'lib/fog/oraclecloud/models/java/instance.rb', line 84 def stopping? status == 'Maintenance' || status == 'Terminating' end |