mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
28 lines
484 B
Ruby
28 lines
484 B
Ruby
|
module Fog
|
||
|
module Compute
|
||
|
class RackspaceV2
|
||
|
class Network < Fog::Model
|
||
|
identity :id
|
||
|
|
||
|
attribute :label
|
||
|
attribute :cidr
|
||
|
|
||
|
def save
|
||
|
requires :label, :cidr
|
||
|
|
||
|
data = service.create_network(label, cidr)
|
||
|
merge_attributes(data.body['network'])
|
||
|
true
|
||
|
end
|
||
|
|
||
|
def destroy
|
||
|
requires :identity
|
||
|
|
||
|
service.delete_network(identity)
|
||
|
true
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|
||
|
end
|