Class: Fog::Compute::Cloudstack::Network
- Inherits:
-
Model
- Object
- Model
- Fog::Compute::Cloudstack::Network
- Defined in:
- lib/fog/cloudstack/models/compute/network.rb
Instance Method Summary collapse
-
#destroy(options = {}) ⇒ Object
delete given network - will return a job.
-
#restart(options = {}) ⇒ Object
restart network - will return a job.
-
#save ⇒ Object
create a new network.
Instance Method Details
#destroy(options = {}) ⇒ Object
delete given network - will return a job
65 66 67 68 |
# File 'lib/fog/cloudstack/models/compute/network.rb', line 65 def destroy(={}) response = service.delete_network(.merge({'id'=> self.id})) service.jobs.new(response["deletenetworkresponse"]) end |
#restart(options = {}) ⇒ Object
restart network - will return a job
44 45 46 47 |
# File 'lib/fog/cloudstack/models/compute/network.rb', line 44 def restart(={}) response = service.restart_network( .merge({'id'=> self.id})) service.jobs.new(response['restartnetworkresponse']) end |
#save ⇒ Object
create a new network
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/fog/cloudstack/models/compute/network.rb', line 50 def save requires :display_text, :name, :network_offering_id, :zone_id = { 'displaytext' => display_text, 'name' => name, 'zoneid' => zone_id, 'networkofferingid' => network_offering_id } response = service.create_network() merge_attributes(response['createnetworkresponse']['network']) end |