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
64 65 66 67 |
# File 'lib/fog/cloudstack/models/compute/network.rb', line 64 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
43 44 45 46 |
# File 'lib/fog/cloudstack/models/compute/network.rb', line 43 def restart(={}) response = service.restart_network( .merge({'id'=> self.id})) service.jobs.new(response['restartnetworkresponse']) end |
#save ⇒ Object
create a new network
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/fog/cloudstack/models/compute/network.rb', line 49 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 |