Class: Fog::Compute::OracleCloud::Orchestration
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::OracleCloud::Orchestration
- Defined in:
- lib/fog/oraclecloud/models/compute/orchestration.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #ready? ⇒ Boolean
- #reload ⇒ Object
- #running? ⇒ Boolean
- #save ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
- #stopped? ⇒ Boolean
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/fog/oraclecloud/models/compute/orchestration.rb', line 36 def create requires :name, :oplans data = service.create_orchestration(name, oplans, :schedule => schedule, :account => account, :description => description, :relationships => relationships) merge_attributes(data.body) end |
#destroy ⇒ Object
72 73 74 75 |
# File 'lib/fog/oraclecloud/models/compute/orchestration.rb', line 72 def destroy requires :name service.delete_orchestration(name) end |
#ready? ⇒ Boolean
24 25 26 |
# File 'lib/fog/oraclecloud/models/compute/orchestration.rb', line 24 def ready? status == 'ready' end |
#reload ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/fog/oraclecloud/models/compute/orchestration.rb', line 56 def reload requires :name data = begin collection.get(name) rescue Excon::Errors::SocketError nil end return unless data new_attributes = data.attributes merge_attributes(new_attributes) self end |
#running? ⇒ Boolean
20 21 22 |
# File 'lib/fog/oraclecloud/models/compute/orchestration.rb', line 20 def running? status == 'running' end |
#save ⇒ Object
32 33 34 |
# File 'lib/fog/oraclecloud/models/compute/orchestration.rb', line 32 def save identity ? update : create end |
#start ⇒ Object
77 78 79 80 |
# File 'lib/fog/oraclecloud/models/compute/orchestration.rb', line 77 def start requires :name service.start_orchestration(name) end |
#stop ⇒ Object
82 83 84 85 |
# File 'lib/fog/oraclecloud/models/compute/orchestration.rb', line 82 def stop requires :name service.stop_orchestration(name) end |
#stopped? ⇒ Boolean
28 29 30 |
# File 'lib/fog/oraclecloud/models/compute/orchestration.rb', line 28 def stopped? status == 'stopped' end |
#update ⇒ Object
46 47 48 49 50 51 52 53 54 |
# File 'lib/fog/oraclecloud/models/compute/orchestration.rb', line 46 def update requires :name, :oplans data = service.update_orchestration(name, oplans, :schedule => schedule, :account => account, :description => description, :relationships => relationships) merge_attributes(data.body) end |