Class: Fog::OracleCloud::Java::Instance

Inherits:
Model
  • Object
show all
Defined in:
lib/fog/oraclecloud/models/java/instance.rb

Instance Method Summary collapse

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

#destroyObject



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

Returns:

  • (Boolean)


80
81
82
# File 'lib/fog/oraclecloud/models/java/instance.rb', line 80

def ready?
  status == "Running"
end

#saveObject



75
76
77
78
# File 'lib/fog/oraclecloud/models/java/instance.rb', line 75

def save
  #identity ? update : create

  create
end

#serversObject



92
93
94
# File 'lib/fog/oraclecloud/models/java/instance.rb', line 92

def servers
  service.servers.all(service_name)
end

#stopped?Boolean

Returns:

  • (Boolean)


88
89
90
# File 'lib/fog/oraclecloud/models/java/instance.rb', line 88

def stopped?
  status == 'Stopped'
end

#stopping?Boolean

Returns:

  • (Boolean)


84
85
86
# File 'lib/fog/oraclecloud/models/java/instance.rb', line 84

def stopping?
  status == 'Maintenance' || status == 'Terminating'
end